From f894a9eeec2ace6d8e21a800e43d621ff02eacf0 Mon Sep 17 00:00:00 2001 From: Atridad Lahiji Date: Thu, 22 Jan 2026 12:18:43 -0700 Subject: [PATCH] Maybe this --- .gitignore | 3 --- Makefile | 15 +---------- flake.nix | 7 +++-- modules/locale.nix | 9 +++---- modules/networking.nix | 5 +--- modules/packages.nix | 11 +++----- modules/users.nix | 9 +++---- scripts/init.sh | 60 ------------------------------------------ settings.example.nix | 11 -------- 9 files changed, 15 insertions(+), 115 deletions(-) delete mode 100644 .gitignore delete mode 100755 scripts/init.sh delete mode 100644 settings.example.nix diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 68451c8..0000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# User-specific configuration (generated by make init) -settings.nix -hardware-configuration.nix diff --git a/Makefile b/Makefile index c1c598c..bbf988f 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,7 @@ -.PHONY: init install link unlink rebuild update purge edit help +.PHONY: install link unlink rebuild update purge help NIXOS_DIR := /etc/nixos REPO_DIR := $(shell pwd) -SETTINGS := settings.nix - # Colors for output GREEN := \033[0;32m YELLOW := \033[0;33m @@ -13,19 +11,11 @@ NC := \033[0m # No Color help: @echo "NixOS Config" @echo "" - @echo " make init - first time setup" @echo " make rebuild - rebuild nixos" @echo " make update - upgrade + rebuild" @echo " make purge - garbage collect" @echo " make link - symlink to /etc/nixos" @echo " make unlink - remove symlink" - @echo " make edit - edit settings.nix" - -init: - @./scripts/init.sh - @$(MAKE) --no-print-directory link - @echo "" - @echo "done. run 'make rebuild' when ready" link: @if [ -L "$(NIXOS_DIR)" ]; then \ @@ -59,6 +49,3 @@ purge: check: nixos-rebuild build --flake . --dry-run - -edit: - @$${EDITOR:-nano} $(SETTINGS) diff --git a/flake.nix b/flake.nix index 5f22ea2..7b13061 100644 --- a/flake.nix +++ b/flake.nix @@ -16,13 +16,12 @@ outputs = { self, nixpkgs, home-manager, hyprland, stylix, ... }@inputs: let - settings = import ./settings.nix; system = "x86_64-linux"; lib = nixpkgs.lib; in { nixosConfigurations = { - "${settings.hostname}" = lib.nixosSystem { + "lavitz" = lib.nixosSystem { inherit system; specialArgs = { inherit inputs; }; modules = [ @@ -32,8 +31,8 @@ { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; - home-manager.users."${settings.username}" = { - home.stateVersion = "24.05"; + home-manager.users."atridad" = { + home.stateVersion = "25.11"; }; home-manager.extraSpecialArgs = { inherit inputs; }; } diff --git a/modules/locale.nix b/modules/locale.nix index fdd4f48..af2ca13 100644 --- a/modules/locale.nix +++ b/modules/locale.nix @@ -1,12 +1,9 @@ { config, pkgs, ... }: -let - settings = import ../settings.nix; -in { # Time zone - time.timeZone = settings.timezone; + time.timeZone = "America/Edmonton"; # Internationalization properties - i18n.defaultLocale = settings.locale; -} \ No newline at end of file + i18n.defaultLocale = "en_CA.UTF-8"; +} diff --git a/modules/networking.nix b/modules/networking.nix index a71ebd2..8d414cc 100644 --- a/modules/networking.nix +++ b/modules/networking.nix @@ -1,10 +1,7 @@ { config, pkgs, ... }: -let - settings = import ../settings.nix; -in { - networking.hostName = settings.hostname; + networking.hostName = "lavitz"; networking.networkmanager = { enable = true; diff --git a/modules/packages.nix b/modules/packages.nix index 77fcae1..4344432 100644 --- a/modules/packages.nix +++ b/modules/packages.nix @@ -1,14 +1,11 @@ { config, pkgs, ... }: -let - settings = import ../settings.nix; -in { # Enable unfree globally nixpkgs.config.allowUnfree = true; environment.variables.BROWSER = "librewolf"; - environment.variables.SSH_AUTH_SOCK = "/home/${settings.username}/.bitwarden-ssh-agent.sock"; + environment.variables.SSH_AUTH_SOCK = "/home/user/.bitwarden-ssh-agent.sock"; environment.systemPackages = with pkgs; [ @@ -71,9 +68,9 @@ in enable = true; config = { user = { - name = "${settings.gitName}"; - email = "${settings.gitEmail}"; - signingkey = "${settings.gitKey}"; + name = "User Name"; + email = "user@email.com"; + signingkey = "ssh-ed25519 ..."; }; gpg.format = "ssh"; commit.gpgsign = true; diff --git a/modules/users.nix b/modules/users.nix index a9ed61c..cd1ce05 100644 --- a/modules/users.nix +++ b/modules/users.nix @@ -1,15 +1,12 @@ { config, pkgs, ... }: -let - settings = import ../settings.nix; -in { users.groups.plugdev.gid = 69420; - users.users.${settings.username} = { + users.users.user = { isNormalUser = true; - description = settings.userDescription; - extraGroups = settings.userGroups; + description = "Atridad"; + extraGroups = [ "networkmanager" "wheel" "docker" "plugdev" ]; }; # Security diff --git a/scripts/init.sh b/scripts/init.sh deleted file mode 100755 index fecee86..0000000 --- a/scripts/init.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env bash - -SETTINGS="settings.nix" -REPO_DIR=$(pwd) -GREEN='\033[0;32m' -YELLOW='\033[0;33m' -RED='\033[0;31m' -NC='\033[0m' # No Color - -# 1. Generate settings.nix -if [ -f "$SETTINGS" ]; then - echo -e "${YELLOW}settings.nix exists. overwrite? [y/N]${NC}" - read -r confirm - if [[ "$confirm" != "y" && "$confirm" != "Y" ]]; then - echo "keeping existing settings" - else - GENERATE=true - fi -else - GENERATE=true -fi - -if [ "$GENERATE" = true ]; then - username=$(whoami) - userdesc=$(getent passwd "$username" | cut -d: -f5 | cut -d, -f1) - userdesc=${userdesc:-$username} - - echo "user: $username ($userdesc)" - echo "" - - echo "hostname:" - read -r hostname - - echo "timezone [America/Edmonton]:" - read -r tz - tz=${tz:-America/Edmonton} - - echo "locale [en_CA.UTF-8]:" - read -r locale - locale=${locale:-en_CA.UTF-8} - - echo "" - echo "{" > "$SETTINGS" - echo " hostname = \"$hostname\";" >> "$SETTINGS" - echo " username = \"$username\";" >> "$SETTINGS" - echo " userDescription = \"$userdesc\";" >> "$SETTINGS" - echo " timezone = \"$tz\";" >> "$SETTINGS" - echo " locale = \"$locale\";" >> "$SETTINGS" - echo " userGroups = [ \"networkmanager\" \"wheel\" \"docker\" \"plugdev\" ];" >> "$SETTINGS" - echo "}" >> "$SETTINGS" - echo "wrote $SETTINGS" -fi - -# 2. Copy hardware-configuration.nix -if [ -f "/etc/nixos/hardware-configuration.nix" ]; then - cp /etc/nixos/hardware-configuration.nix "$REPO_DIR/hardware-configuration.nix" - echo "copied hardware-configuration.nix" -else - echo -e "${YELLOW}no hardware-configuration.nix found - run nixos-generate-config first${NC}" -fi diff --git a/settings.example.nix b/settings.example.nix deleted file mode 100644 index 83ca3fb..0000000 --- a/settings.example.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - hostname = "nixos"; - username = "user"; - userDescription = "User"; - timezone = "America/Edmonton"; - locale = "en_CA.UTF-8"; - userGroups = [ "networkmanager" "wheel" "docker" "plugdev" ]; - gitName = "User Name"; - gitEmail = "user@email.com"; - gitKey = "ssh-ed25519 ..."; -}