diff --git a/configs/common.nix b/configs/common.nix index ddf8f5c..40a991e 100644 --- a/configs/common.nix +++ b/configs/common.nix @@ -5,7 +5,18 @@ nixpkgs, agenix, ... -}: { +}: let + username = "leo"; + stateVersion = "23.11"; +in { + imports = [ + (lib.mkAliasOptionModule ["hm"] ["home-manager" "users" username]) + + ../programs/fish.nix + ../programs/git.nix + ../programs/starship + ]; + age = { identityPaths = ["/etc/age/key"]; @@ -39,6 +50,10 @@ }; }; + hm.home = { + inherit stateVersion; + }; + home-manager = { useGlobalPkgs = true; useUserPackages = true; @@ -109,7 +124,19 @@ time.timeZone = "Europe/Paris"; - users.users.root.hashedPasswordFile = config.age.secrets.rootPassword.path; + users.users = { + "${username}" = { + isNormalUser = true; + shell = pkgs.fish; + extraGroups = ["networkmanager" "wheel" "video" "libvirtd"]; + hashedPasswordFile = config.age.secrets.userPassword.path; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN+7+KfdOrhcnHayxvOENUeMx8rE4XEIV/AxMHiaNUP8" + ]; + }; + + root.hashedPasswordFile = config.age.secrets.rootPassword.path; + }; # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions @@ -117,5 +144,5 @@ # this value at the release version of the first install of this system. # Before changing this value read the documentation for this option # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = lib.mkDefault "23.11"; # Did you read the comment? + system.stateVersion = lib.mkDefault stateVersion; # Did you read the comment? } diff --git a/configs/server.nix b/configs/server.nix deleted file mode 100644 index 012e86d..0000000 --- a/configs/server.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ - lib, - pkgs, - config, - ... -}: let - username = "uku"; -in { - imports = [ - (lib.mkAliasOptionModule ["hm"] ["home-manager" "users" username]) - - ../programs/fish.nix - ../programs/git.nix - ../programs/starship - ]; - - hm.home.stateVersion = "23.11"; - - services.tailscale.extraUpFlags = ["--advertise-exit-node"]; - - users.users."${username}" = { - isNormalUser = true; - shell = pkgs.fish; - extraGroups = ["networkmanager" "wheel"]; - hashedPasswordFile = config.age.secrets.userPassword.path; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIN+7+KfdOrhcnHayxvOENUeMx8rE4XEIV/AxMHiaNUP8" - ]; - }; -} diff --git a/systems/default.nix b/systems/default.nix index 20efe92..4067cd0 100644 --- a/systems/default.nix +++ b/systems/default.nix @@ -37,8 +37,6 @@ catppuccin.nixosModules.catppuccin ] ++ nixos; - - server = nixos ++ [../configs/server.nix]; in { flake.nixosConfigurations = mapNixOS { fuji = { @@ -63,7 +61,7 @@ in { etna = { system = "x86_64-linux"; modules = - server + nixos ++ (with inputs; [ api-rs.nixosModules.default ukubot-rs.nixosModules.default diff --git a/systems/etna/default.nix b/systems/etna/default.nix index adceadc..60fb580 100644 --- a/systems/etna/default.nix +++ b/systems/etna/default.nix @@ -27,6 +27,8 @@ reposilite.enable = true; + tailscale.extraUpFlags = ["--advertise-exit-node"]; + vaultwarden = { enable = true; config = { diff --git a/systems/fuji-wsl/default.nix b/systems/fuji-wsl/default.nix index 64802b8..d2c931c 100644 --- a/systems/fuji-wsl/default.nix +++ b/systems/fuji-wsl/default.nix @@ -1,30 +1,6 @@ { - lib, - pkgs, - config, - ... -}: let - username = "leo"; -in { - imports = [ - (lib.mkAliasOptionModule ["hm"] ["home-manager" "users" username]) - - ../../programs/fish.nix - ../../programs/git.nix - ../../programs/starship - ]; - - hm.home.stateVersion = "23.11"; - wsl = { enable = true; - defaultUser = username; - }; - - users.users."${username}" = { - isNormalUser = true; - shell = pkgs.fish; - extraGroups = ["wheel"]; - hashedPasswordFile = config.age.secrets.userPassword.path; + defaultUser = "leo"; }; }