From 171cd02f632120fc9d50b2f8e1a76d7da13744b0 Mon Sep 17 00:00:00 2001 From: Bit Borealis Date: Thu, 11 May 2023 10:14:17 +0000 Subject: [PATCH] migrated user to sysConf user and added custom user configuration --- default.nix | 11 ++++--- hosts/terra/default.nix | 1 + users/hive/default.nix | 53 +++++++++++++++++++++++++++++++++ home.nix => users/hive/home.nix | 1 + 4 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 users/hive/default.nix rename home.nix => users/hive/home.nix (99%) diff --git a/default.nix b/default.nix index 82bd6dc..a332234 100644 --- a/default.nix +++ b/default.nix @@ -8,12 +8,15 @@ let "https://github.com/nix-community/home-manager/archive/master.tar.gz"; homeManager = import "${homeManagerTarball}/nixos"; deviceConf = import "${projectRoot}/hosts/${sysConf.host}/"; + userDir = "${projectRoot}/users/${sysConf.user}/"; + userConf = import userDir; unstable = import unstableTarball config.nixpkgs.config; sysConf = import ./saturn/system.nix; in { imports = [ homeManager deviceConf + userConf ./modules ]; @@ -80,15 +83,15 @@ in { }; # add and configure users - users.users.hive = { + users.users.${sysConf.user} = { initialPassword = ""; isNormalUser = true; - description = "The Hive"; - extraGroups = [ "networkmanager" "wheel" "dialout" ]; + description = "${sysConf.user}"; + extraGroups = [ "networkmanager" "wheel" ]; }; # import home-manager config from home.nix - home-manager.users.hive = import ./home.nix; + home-manager.users.${sysConf.user} = import "${userDir}/home.nix"; # install packages # `nix search` to add more diff --git a/hosts/terra/default.nix b/hosts/terra/default.nix index 69f5152..4523d40 100644 --- a/hosts/terra/default.nix +++ b/hosts/terra/default.nix @@ -4,4 +4,5 @@ ./hardware-configuration.nix ./luks.nix ]; + programs.steam.enable = true; } diff --git a/users/hive/default.nix b/users/hive/default.nix new file mode 100644 index 0000000..e93a1a8 --- /dev/null +++ b/users/hive/default.nix @@ -0,0 +1,53 @@ +{ ... } : +{ + services.syncthing = { + enable = true; + user = "hive"; + configDir = "/home/hive/.config/syncthing"; + overrideDevices = false; + overrideFolders = false; + devices = { "impostor" = { + id = "XBG44HU-OVOC6RN-4DHMDRH-WPL7OPW-XBYYOMK-DV5GGGA-LEP6HCJ-QVPMSAI"; + introducer = true; + }; }; + folders = { + "ssh" = { + id = "mkkgo-chqwk"; + path = "~/.ssh"; + devices = [ "impostor" ]; + ignorePerms = false; + }; + "decsync" = { + id = "20lk1-ims07"; + path = "~/.local/share/decsync"; + devices = [ "impostor" ]; + }; + "scripts" = { + id = "6nunu-quun5"; + path = "~/.local/bin/scripts"; + devices = [ "impostor" ]; + + }; + "dotfiles" = { + id = "sjgew-vdpfl"; + path = "~/.dotfiles"; + devices = [ "impostor" ]; + }; + "password-store" = { + id = "tadwa-1va0d"; + path = "~/.local/share/pass"; + devices = [ "impostor" ]; + }; + "notes" = { + id = "y0a00-2ha8l"; + path = "~/Notes"; + devices = [ "impostor" ]; + }; + "documents" = { + id = "y7ecb-v9ds7"; + path = "~/Documents"; + devices = [ "impostor" ]; + }; + }; + }; +} diff --git a/home.nix b/users/hive/home.nix similarity index 99% rename from home.nix rename to users/hive/home.nix index 2a565de..4b8ee9e 100644 --- a/home.nix +++ b/users/hive/home.nix @@ -13,6 +13,7 @@ dino termpdfpy # unstable.fluffychat + skim syncthing armcord ripgrep