From baafee0a16bf9a0964044d44488b755c393cf761 Mon Sep 17 00:00:00 2001 From: alydev Date: Wed, 24 Sep 2025 11:43:41 +1000 Subject: [PATCH] test --- .../authorized_keys.nix | 0 flake.nix | 71 ++-------------- home.nix | 81 ------------------- home/aly.nix | 31 +++++++ hw-aly-laptop.nix => hw/aly-laptop.nix | 0 system/aly-laptop.nix | 8 ++ system/global.nix | 45 +++++++++++ 7 files changed, 89 insertions(+), 147 deletions(-) rename authorized_keys.nix => data/authorized_keys.nix (100%) delete mode 100644 home.nix create mode 100644 home/aly.nix rename hw-aly-laptop.nix => hw/aly-laptop.nix (100%) create mode 100644 system/aly-laptop.nix create mode 100644 system/global.nix diff --git a/authorized_keys.nix b/data/authorized_keys.nix similarity index 100% rename from authorized_keys.nix rename to data/authorized_keys.nix diff --git a/flake.nix b/flake.nix index 0252660..4565376 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,4 @@ { - description = "NixOS configuration"; - inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05"; home-manager = { @@ -11,77 +9,18 @@ outputs = inputs@{ nixpkgs, home-manager, ... }: { nixosConfigurations = { - aly-laptop = nixpkgs.lib.nixosSystem { + "aly-laptop" = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ - ./hw-aly-laptop.nix - ({ config, pkgs, ... }: { - networking.hostName = "aly-laptop"; - services.logind = { - lidSwitch = "suspend"; - lidSwitchDocked = "ignore"; - lidSwitchExternalPower = "ignore"; - }; - }) - ({ config, pkgs, ... }: { - system.stateVersion = "25.05"; - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; - environment.systemPackages = with pkgs; [ - cargo rustc just git vim wget obs-studio gcc gnumake autoconf automake pkg-config rpi-imager - ]; - environment.variables.EDITOR = "vim"; - security.sudo.wheelNeedsPassword = false; - - networking.networkmanager.enable = true; - - services.flatpak.enable = true; - services.pulseaudio.enable = false; - services.pipewire = { - enable = true; - pulse.enable = true; - }; - time.timeZone = "Australia/Brisbane"; - users.users.aly = { - isNormalUser = true; - description = "aly"; - hashedPassword = "$y$j9T$Q.yFJjo9LMA8o.7Ac5uSr/$Y8pYIPSzCXHSd4nAlUohaaohwpquK6XEIjxFKq3J4s/"; - openssh.authorizedKeys.keys = import ./authorized_keys.nix; - extraGroups = [ "networkmanager" "wheel" ]; - }; - - # Enable the OpenSSH daemon. - services.openssh = { - enable = true; - settings = { - X11Forwarding = true; - PermitRootLogin = "no"; # disable root login - PasswordAuthentication = false; # disable password login - }; - openFirewall = true; - }; - # Enable the X11 windowing system. - services.xserver.enable = true; - - # Enable the GNOME Desktop Environment. - services.xserver.displayManager.gdm.enable = true; - services.xserver.desktopManager.gnome.enable = true; - }) - + ./hw/aly-laptop.nix + ./system/aly-laptop.nix + ./system/global.nix home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; - - home-manager.users.aly = import ./home.nix; - - # Optionally, use home-manager.extraSpecialArgs to pass arguments to home.nix + home-manager.users.aly = import ./home/aly.nix; } - - ({ pkgs, ... }: { - environment.etc."nixos".source = ./.; - }) ]; }; }; diff --git a/home.nix b/home.nix deleted file mode 100644 index 26fa3e7..0000000 --- a/home.nix +++ /dev/null @@ -1,81 +0,0 @@ -{ config, pkgs, ... }: - -{ - home.username = "aly"; - home.homeDirectory = "/home/aly"; - xresources.properties = { - "Xcursor.size" = 16; - "Xft.dpi" = 172; - }; - home.packages = with pkgs; [ - gnome-tweaks - firefox - neofetch - nnn - zip - xz - unzip - p7zip - ripgrep - jq - yq-go - mtr - iperf3 - dnsutils - ldns - aria2 - socat - nmap - ipcalc - file - which - tree - gnused - gnutar - gawk - zstd - gnupg - nix-output-monitor - - btop - iotop - iftop - strace - ltrace - lsof - sysstat - lm_sensors - ethtool - pciutils - usbutils - ]; - programs.git = { - enable = true; - userName = "alydev"; - userEmail = "alyssa.dev.smith@gmail.com"; - }; - - # alacritty - a cross-platform, GPU-accelerated terminal emulator -# programs.alacritty = { -# enable = true; -# # custom settings -# settings = { -# env.TERM = "xterm-256color"; -# font = { -# size = 12; -# draw_bold_text_with_bright_colors = true; -# }; -# scrolling.multiplier = 5; -# selection.save_to_clipboard = true; -# }; -# }; - - programs.bash = { - enable = true; - enableCompletion = true; - bashrcExtra = '' - export PATH="$PATH:$HOME/bin:$HOME/.local/bin:$HOME/go/bin" - ''; - }; - home.stateVersion = "25.05"; -} diff --git a/home/aly.nix b/home/aly.nix new file mode 100644 index 0000000..7e5d313 --- /dev/null +++ b/home/aly.nix @@ -0,0 +1,31 @@ +{ config, pkgs, ... }: + +{ + home.username = "aly"; + home.homeDirectory = "/home/aly"; + xresources.properties = { + "Xcursor.size" = 16; + "Xft.dpi" = 172; + }; + home.packages = with pkgs; [ + gnome-tweaks firefox obs-studio rpi-imager + neofetch nnn zip xz unzip p7zip ripgrep jq yq-go mtr iperf3 dnsutils + ldns aria2 socat nmap ipcalc file which tree gnused gnutar gawk zstd + gnupg btop iotop iftop strace ltrace lsof sysstat lm_sensors ethtool + pciutils usbutils nix-output-monitor + ]; + programs.git = { + enable = true; + userName = "alydev"; + userEmail = "alyssa.dev.smith@gmail.com"; + }; + + programs.bash = { + enable = true; + enableCompletion = true; + bashrcExtra = '' + export PATH="$PATH:$HOME/bin:$HOME/.local/bin:$HOME/go/bin" + ''; + }; + home.stateVersion = "25.05"; +} diff --git a/hw-aly-laptop.nix b/hw/aly-laptop.nix similarity index 100% rename from hw-aly-laptop.nix rename to hw/aly-laptop.nix diff --git a/system/aly-laptop.nix b/system/aly-laptop.nix new file mode 100644 index 0000000..6784bbd --- /dev/null +++ b/system/aly-laptop.nix @@ -0,0 +1,8 @@ +({ config, pkgs, ... }: { + networking.hostName = "aly-laptop"; + services.logind = { + lidSwitch = "suspend"; + lidSwitchDocked = "ignore"; + lidSwitchExternalPower = "ignore"; + }; +}) diff --git a/system/global.nix b/system/global.nix new file mode 100644 index 0000000..8ffbaae --- /dev/null +++ b/system/global.nix @@ -0,0 +1,45 @@ +({ config, pkgs, ... }: { + system.stateVersion = "25.05"; + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + nix.settings.experimental-features = [ "nix-command" "flakes" ]; + environment.systemPackages = with pkgs; [ + cargo rustc just git vim wget gcc gnumake autoconf automake pkg-config + ]; + environment.variables.EDITOR = "vim"; + security.sudo.wheelNeedsPassword = false; + + networking.networkmanager.enable = true; + + services.flatpak.enable = true; + services.pulseaudio.enable = false; + services.pipewire = { + enable = true; + pulse.enable = true; + }; + time.timeZone = "Australia/Brisbane"; + users.users.aly = { + isNormalUser = true; + description = "aly"; + hashedPassword = "$y$j9T$Q.yFJjo9LMA8o.7Ac5uSr/$Y8pYIPSzCXHSd4nAlUohaaohwpquK6XEIjxFKq3J4s/"; + openssh.authorizedKeys.keys = import ../data/authorized_keys.nix; + extraGroups = [ "networkmanager" "wheel" ]; + }; + + # Enable the OpenSSH daemon. + services.openssh = { + enable = true; + settings = { + X11Forwarding = true; + PermitRootLogin = "no"; # disable root login + PasswordAuthentication = false; # disable password login + }; + openFirewall = true; + }; + # Enable the X11 windowing system. + services.xserver.enable = true; + + # Enable the GNOME Desktop Environment. + services.xserver.displayManager.gdm.enable = true; + services.xserver.desktopManager.gnome.enable = true; +})