From e8e42fb16314067e892a9f0faf223a1d289e8456 Mon Sep 17 00:00:00 2001 From: Andrew Williams Date: Wed, 27 Mar 2024 21:23:45 +0000 Subject: [PATCH] First attempt at splitting out common config items --- common.nix | 17 +++++++++++++++++ machines/talos/configuration.nix | 26 +------------------------- users.nix | 19 +++++++++++++++++++ 3 files changed, 37 insertions(+), 25 deletions(-) create mode 100644 common.nix create mode 100644 users.nix diff --git a/common.nix b/common.nix new file mode 100644 index 0000000..9b080ba --- /dev/null +++ b/common.nix @@ -0,0 +1,17 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + users.nix + ]; + + # Set your time zone. + time.timeZone = "Europe/London"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_GB.UTF-8"; + console = { + font = "Lat2-Terminus16"; + useXkbConfig = true; # use xkb.options in tty. + }; +} \ No newline at end of file diff --git a/machines/talos/configuration.nix b/machines/talos/configuration.nix index 70aeafc..6e38a37 100644 --- a/machines/talos/configuration.nix +++ b/machines/talos/configuration.nix @@ -8,6 +8,7 @@ imports = [ # Include the results of the hardware scan. ./hardware-configuration.nix + ../../common.nix ]; system.copySystemConfiguration = true; @@ -27,16 +28,6 @@ networking.networkmanager.enable = true; networking.firewall.enable = true; - # Set your time zone. - time.timeZone = "Europe/London"; - - # Select internationalisation properties. - i18n.defaultLocale = "en_GB.UTF-8"; - console = { - font = "Lat2-Terminus16"; - useXkbConfig = true; # use xkb.options in tty. - }; - # Enable the X11 windowing system. services.xserver.enable = true; services.xserver.displayManager.gdm.enable = true; @@ -78,21 +69,6 @@ environment.sessionVariables = { LIBVA_DRIVER_NAME = "iHD"; }; # Force intel-media-driver # Define a user account. Don't forget to set a password with ‘passwd’. - users = { - defaultUserShell = pkgs.zsh; - users.nikdoof = { - isNormalUser = true; - extraGroups = - [ - "wheel" - "video" - ]; - shell = pkgs.zsh; - openssh.authorizedKeys.keys = [ - "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHWO2qwHaPaQs46na4Aa6gMkw5QqRHUMGQphtgAcDJOw" - ]; - }; - }; # List packages installed in system profile environment.systemPackages = with pkgs; [ diff --git a/users.nix b/users.nix new file mode 100644 index 0000000..47f8145 --- /dev/null +++ b/users.nix @@ -0,0 +1,19 @@ +{ config, lib, pkgs, ... }: + +{ + users = { + defaultUserShell = pkgs.zsh; + users.nikdoof = { + isNormalUser = true; + extraGroups = + [ + "wheel" + "video" + ]; + shell = pkgs.zsh; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHWO2qwHaPaQs46na4Aa6gMkw5QqRHUMGQphtgAcDJOw" + ]; + }; + }; +} \ No newline at end of file