From b70e37770a0c5d58df87006f9e995eadb7e0641e Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Sun, 14 Feb 2021 13:18:13 +0100 Subject: [PATCH] base: setup default config --- base/default.nix | 6 ++++++ base/users.nix | 16 ++++++++++++++++ configuration.nix | 19 ++++--------------- 3 files changed, 26 insertions(+), 15 deletions(-) create mode 100644 base/default.nix create mode 100644 base/users.nix 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; [