diff --git a/base/default.nix b/base/default.nix new file mode 100644 index 0000000..eca8422 --- /dev/null +++ b/base/default.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + imports = [ + ./users.nix + ]; +} diff --git a/base/users.nix b/base/users.nix new file mode 100644 index 0000000..69c1e47 --- /dev/null +++ b/base/users.nix @@ -0,0 +1,16 @@ +{ config, lib, pkgs, ... }: +{ + users.mutableUsers = false; + users.users.root = { + hashedPassword = lib.fileContents ../secrets/shadow-hashed-password-root; + }; + users.users.alarsyo = { + hashedPassword = lib.fileContents ../secrets/shadow-hashed-password-alarsyo; + isNormalUser = true; + extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + shell = pkgs.fish; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH3rrF3VSWI4n4cpguvlmLAaU3uftuX4AVV/39S/8GO9 alarsyo@thinkpad" + ]; + }; +} diff --git a/configuration.nix b/configuration.nix index 23ecef4..1a55e9b 100644 --- a/configuration.nix +++ b/configuration.nix @@ -8,7 +8,11 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix + ./services + + # Default configuration + ./base ]; # Use the GRUB 2 boot loader. @@ -41,21 +45,6 @@ "62.210.16.7" ]; - # Define a user account. - users.mutableUsers = false; - users.users.root = { - hashedPassword = lib.fileContents ./secrets/shadow-hashed-password-root; - }; - users.users.alarsyo = { - hashedPassword = lib.fileContents ./secrets/shadow-hashed-password-alarsyo; - isNormalUser = true; - extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. - shell = pkgs.fish; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH3rrF3VSWI4n4cpguvlmLAaU3uftuX4AVV/39S/8GO9 alarsyo@thinkpad" - ]; - }; - # List packages installed in system profile. To search, run: # $ nix search wget environment.systemPackages = with pkgs; [