diff --git a/configuration.nix b/configuration.nix index 26ac67e..c03b0c9 100644 --- a/configuration.nix +++ b/configuration.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, userSettings, systemSettings, ... }: { nix.settings.experimental-features = [ "nix-command" "flakes" ]; @@ -10,7 +10,7 @@ git eza ]; - + # For SSH access services.openssh.enable = true; @@ -23,4 +23,13 @@ execWheelOnly = false; wheelNeedsPassword = false; # allows sudo without password for those in the wheel group }; + + users.users.${userSettings.username} = { + isNormalUser = true; + uid = 1000; + extraGroups = [ "wheel" "networkmanager" ]; + openssh.authorizedKeys.keyFiles = [ /root/.ssh/authorized_keys ]; + }; + + time.timeZone = "${systemSettings.timeZone}"; } diff --git a/flake.nix b/flake.nix index b3bf8d7..91415cf 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "Loki flake config"; + description = "Panoptes flake config"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; @@ -20,39 +20,43 @@ ... } @ inputs: let + stateVersion = "24.11"; inherit (self) outputs; - system = "x86_64-linux"; - pkgs = nixpkgs.legacyPackages.${system}; - stateVersion = "24.05"; + nixosSystem = inputs.nixpkgs.lib.nixosSystem; + + userSettings = rec { + username = "panoptes"; + gitUserName = "John Lancaster"; + gitUserEmail = "32917998+jsl12@users.noreply.github.com"; + }; - # userSettings = rec { - # username = "shahvirb"; # username on the system - # name = "Shahvir"; # name/identifier on the system - # email = "shahvirb@gmail.com"; - # gitUserName = "shahvirb"; - # gitUserEmail = "shahvirb@gmail.com"; - # }; + systemSettings = rec { + hostname = "panoptes-nix"; + system = "x86_64-linux"; + timeZone = "America/Chicago"; + locale = "en_US.UTF-8"; + }; + + pkgs = inputs.nixpkgs.legacyPackages.${systemSettings.system}; - timeZone = "America/Chicago"; - hostname = "panoptes-nix"; - user = "panoptes"; in { nixosConfigurations = { - ${hostname} = nixpkgs.lib.nixosSystem { - specialArgs = {inherit inputs outputs;}; + "${systemSettings.hostname}" = nixosSystem { + system = systemSettings.system; + specialArgs = { + inherit inputs; + inherit outputs; + inherit userSettings; + inherit systemSettings; + }; modules = [ ./configuration.nix # > Our main nixos configuration file < - "${nixpkgs}/nixos/modules/virtualisation/proxmox-lxc.nix" + "${inputs.nixpkgs}/nixos/modules/virtualisation/proxmox-lxc.nix" ({ ... }: { - nixpkgs.hostPlatform = "${system}"; + # nixpkgs.hostPlatform = "${system}"; system.stateVersion = "${stateVersion}"; - time.timeZone = "${timeZone}"; - users.users.${user} = { - extraGroups = [ "wheel" ]; - isNormalUser = true; - openssh.authorizedKeys.keyFiles = [ /root/.ssh/authorized_keys ]; - }; + # time.timeZone = "${systemSettings.timeZone}"; services.vscode-server.enable = true; }) inputs.vscode-server.nixosModules.default