From b60bacf752ac9df9bc090f1d85a3752274eedc7d Mon Sep 17 00:00:00 2001
From: Leyla Becker <git@jan-leila.com>
Date: Sun, 10 Mar 2024 04:28:47 -0500
Subject: [PATCH] made user files

---
 README.md                       |   1 +
 flake.nix                       |   1 -
 hosts/horizon/configuration.nix | 131 ++++----------------------------
 users/default.nix               |   6 ++
 users/ester/default.nix         |  23 ++++++
 users/eve/default.nix           |  25 ++++++
 users/leyla/default.nix         |  69 +++++++++++++++++
 7 files changed, 137 insertions(+), 119 deletions(-)
 create mode 100644 README.md
 create mode 100644 users/default.nix
 create mode 100644 users/ester/default.nix
 create mode 100644 users/eve/default.nix
 create mode 100644 users/leyla/default.nix

diff --git a/README.md b/README.md
new file mode 100644
index 0000000..f3290d2
--- /dev/null
+++ b/README.md
@@ -0,0 +1 @@
+sudo nixos-rebuild switch --flake .#horizon
\ No newline at end of file
diff --git a/flake.nix b/flake.nix
index 9be492f..bc7b3d1 100644
--- a/flake.nix
+++ b/flake.nix
@@ -18,7 +18,6 @@
       pkgs = nixpkgs.legacyPackages.${system};
     in
     {
-    
       nixosConfigurations = {
         horizon = nixpkgs.lib.nixosSystem {
           specialArgs = {inherit inputs;};
diff --git a/hosts/horizon/configuration.nix b/hosts/horizon/configuration.nix
index a0e247e..14520a0 100644
--- a/hosts/horizon/configuration.nix
+++ b/hosts/horizon/configuration.nix
@@ -3,10 +3,13 @@
 
 {
   imports =
-    [ # Include the results of the hardware scan.
-      ./hardware-configuration.nix
+    [
       inputs.home-manager.nixosModules.default
       inputs.sops-nix.nixosModules.sops
+
+      ./hardware-configuration.nix
+      
+      ../../users
     ];
 
   sops.defaultSopsFile = ../../secrets/secrets.yaml;
@@ -22,13 +25,9 @@
 
   nix.settings.experimental-features = [ "nix-command" "flakes" ];
 
-  networking.hostName = "leyla-laptop"; # Define your hostname.
+  networking.hostName = "horizon"; # Define your hostname.
   # networking.wireless.enable = true;  # Enables wireless support via wpa_supplicant.
 
-  # Configure network proxy if necessary
-  # networking.proxy.default = "http://user:password@proxy:port/";
-  # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";
-
   # Enable networking
   networking.networkmanager.enable = true;
 
@@ -88,14 +87,11 @@
   };
 
   # enabled virtualisation for docker
-  virtualisation.docker.enable = true;
+  # virtualisation.docker.enable = true;
 
   # Enable touchpad support (enabled default in most desktopManager).
   # services.xserver.libinput.enable = true;
 
-  # Disables creating or editing users though methods not defined in this file
-  users.mutableUsers = false;
-
   nixpkgs.config.permittedInsecurePackages = [
     "electron-25.9.0"
   ];
@@ -125,107 +121,6 @@
     })
   ];
 
-  sops.secrets."passwords/leyla".neededForUsers = true;
-  sops.secrets."passwords/ester".neededForUsers = true;
-  sops.secrets."passwords/eve".neededForUsers = true;
-
-  # Define user accounts
-  users.users = {
-    leyla = {
-      isNormalUser = true;
-      uid = 1000;
-      description = "Leyla";
-      extraGroups = [ "networkmanager" "wheel" "docker" ];
-
-      hashedPasswordFile = config.sops.secrets."passwords/leyla".path;
-      
-      packages = with pkgs; [
-        iputils
-        dnsutils
-        git
-        firefox
-        signal-desktop
-        obsidian
-        bitwarden
-#        vscode
-        vscodium
-        nextcloud-client
-        inkscape
-        steam
-        discord
-        rhythmbox
-        makemkv
-        protonvpn-gui
-        transmission-gtk
-        freecad
-        mupen64plus
-        dbeaver
-        easytag
-        cura
-        kicad-small
-#        jdk
-#        android-tools
-#        android-studio
-        androidStudioPackages.canary
-        jetbrains.idea-community
-        ungoogled-chromium
-	      nodejs
-        exiftool
-        libreoffice
-        # N64 Emulator
-        mupen64plus
-        # GameCube Emulator and Wii Emulator
-        dolphin-emu
-        # Switch Emulator
-        yuzu-mainline
-        # Atari 2600 Emulator
-        stella
-        # mame Emulator
-        mame
-        # Game Boy Advanced Emulator
-        vbam
-        # NES Emulator
-        fceux
-        # SNES Emulator
-        zsnes
-        # DS Emulator
-        desmume
-      ];
-    };
-
-    eve = {
-      isNormalUser = true;
-      uid = 1001;
-      description = "Eve";
-      extraGroups = [ "networkmanager" ];
-
-      hashedPasswordFile = config.sops.secrets."passwords/eve".path;
-
-      packages = with pkgs; [
-        firefox
-        bitwarden
-        discord
-        makemkv
-        signal-desktop
-      ];
-    };
-
-    ester = {
-      isNormalUser = true;
-      uid = 1002;
-      description = "Ester";
-      extraGroups = [ "networkmanager" ];
-
-      hashedPasswordFile = config.sops.secrets."passwords/ester".path;
-
-      packages = with pkgs; [
-        firefox
-        bitwarden
-        discord
-      ];
-    };
-  };
-
   # Allow unfree packages
   nixpkgs.config.allowUnfree = true;
 
@@ -233,13 +128,13 @@
   # $ nix search wget
   environment.systemPackages = with pkgs; [
   #  vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
-    wget
+    # wget
     # resilio-sync
-    yt-dlp
-    spotdl
-    ffmpeg
-    chromaprint
-    docker
+    # yt-dlp
+    # spotdl
+    # ffmpeg
+    # chromaprint
+    # docker
     aileron
 #    sox
 #    songrec
diff --git a/users/default.nix b/users/default.nix
new file mode 100644
index 0000000..8471c05
--- /dev/null
+++ b/users/default.nix
@@ -0,0 +1,6 @@
+{...}:
+{
+  imports = [ ./leyla ./ester ./eve ];
+
+  users.mutableUsers = false;
+}
\ No newline at end of file
diff --git a/users/ester/default.nix b/users/ester/default.nix
new file mode 100644
index 0000000..3108fca
--- /dev/null
+++ b/users/ester/default.nix
@@ -0,0 +1,23 @@
+{ lib, config, pkgs, ... }:
+{
+  sops.secrets."passwords/ester" = {
+    neededForUsers = true;
+    # sopsFile = ../secrets.yaml;
+  };
+
+  # Define user accounts
+  users.users.ester = {
+    isNormalUser = true;
+    uid = 1001;
+    description = "Ester";
+    extraGroups = [ "networkmanager" ];
+
+    hashedPasswordFile = config.sops.secrets."passwords/ester".path;
+
+    packages = with pkgs; [
+      firefox
+      bitwarden
+      discord
+    ];
+  };
+}
\ No newline at end of file
diff --git a/users/eve/default.nix b/users/eve/default.nix
new file mode 100644
index 0000000..c6ae188
--- /dev/null
+++ b/users/eve/default.nix
@@ -0,0 +1,25 @@
+{ lib, config, pkgs, ... }:
+{
+  sops.secrets."passwords/eve" = {
+    neededForUsers = true;
+    # sopsFile = ../secrets.yaml;
+  };
+
+  # Define user accounts
+  users.users.eve = {
+    isNormalUser = true;
+    uid = 1002;
+    description = "Eve";
+    extraGroups = [ "networkmanager" ];
+
+    hashedPasswordFile = config.sops.secrets."passwords/eve".path;
+
+    packages = with pkgs; [
+      firefox
+      bitwarden
+      discord
+      makemkv
+      signal-desktop
+    ];
+  };
+}
\ No newline at end of file
diff --git a/users/leyla/default.nix b/users/leyla/default.nix
new file mode 100644
index 0000000..d902f51
--- /dev/null
+++ b/users/leyla/default.nix
@@ -0,0 +1,69 @@
+{ lib, config, pkgs, ... }:
+{
+  sops.secrets."passwords/leyla" = {
+    neededForUsers = true;
+    # sopsFile = ../secrets.yaml;
+  };
+
+  # Define user accounts
+  users.users.leyla = {
+    isNormalUser = true;
+    uid = 1000;
+    description = "Leyla";
+    extraGroups = [ "networkmanager" "wheel" ];
+
+    hashedPasswordFile = config.sops.secrets."passwords/leyla".path;
+    
+    packages = with pkgs; [
+      iputils
+      dnsutils
+      git
+      firefox
+      signal-desktop
+      obsidian
+      bitwarden
+      vscodium
+      nextcloud-client
+      inkscape
+      steam
+      discord
+      rhythmbox
+      makemkv
+      protonvpn-gui
+      transmission-gtk
+      freecad
+      mupen64plus
+      dbeaver
+      easytag
+      cura
+      kicad-small
+#        jdk
+#        android-tools
+#        android-studio
+      androidStudioPackages.canary
+      jetbrains.idea-community
+      ungoogled-chromium
+      nodejs
+      exiftool
+      libreoffice
+      # N64 Emulator
+      mupen64plus
+      # GameCube Emulator and Wii Emulator
+      dolphin-emu
+      # Switch Emulator
+      yuzu-mainline
+      # Atari 2600 Emulator
+      stella
+      # mame Emulator
+      mame
+      # Game Boy Advanced Emulator
+      vbam
+      # NES Emulator
+      fceux
+      # SNES Emulator
+      zsnes
+      # DS Emulator
+      desmume
+    ];
+  };
+}
\ No newline at end of file