about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2022-01-18 17:38:31 +0900
committersefidel <contact@sefidel.net>2022-01-18 17:38:31 +0900
commit7a372ed81256ce5d6aa608be9bebe173ab4e042e (patch)
tree29c7ee0a316ae0dc21ce3fe22342ec2c36ee0f4c /lib
parent2bdc141bebd35cc38396271c42b23b6f89d032a0 (diff)
downloadnixrc-7a372ed81256ce5d6aa608be9bebe173ab4e042e.tar.gz
nixrc-7a372ed81256ce5d6aa608be9bebe173ab4e042e.zip
project: rewrite
Diffstat (limited to 'lib')
-rw-r--r--lib/mk_home.nix11
-rw-r--r--lib/mk_system.nix12
2 files changed, 14 insertions, 9 deletions
diff --git a/lib/mk_home.nix b/lib/mk_home.nix
index 7abe42a..52acc96 100644
--- a/lib/mk_home.nix
+++ b/lib/mk_home.nix
@@ -1,20 +1,23 @@
 { self, home-manager, ... } @ inputs:
 
-username: hostname: system: nixpkgs: version:
+{ username, hostname, system, pkgs, version, extraModules }:
 let
   args = inputs;
-  entrypoint = "${self}/home/configurations/${username}@${hostname}.nix";
+  entrypoint = "${self}/home/${hostname}/${username}.nix";
 in
 home-manager.lib.homeManagerConfiguration {
   inherit username system;
   homeDirectory = "/home/${username}";
   stateVersion = version;
-  pkgs = nixpkgs.legacyPackages.${system};
+  pkgs = pkgs;
 
   configuration = { lib, ... }: {
     _module = { inherit args; };
+
+    profiles.base.enable = true;
+
     imports = [
       entrypoint
-    ] ++ __attrValues self.homeModules;
+    ] ++ lib.optionals (extraModules != null) extraModules;
   };
 }
diff --git a/lib/mk_system.nix b/lib/mk_system.nix
index ee0037b..d6a6d79 100644
--- a/lib/mk_system.nix
+++ b/lib/mk_system.nix
@@ -1,11 +1,11 @@
 { self, ... } @ args:
 
-name: nixpkgs:
+{ name, nixpkgs, extraModules }:
 nixpkgs.lib.nixosSystem (
   let
-    configFolder = "${self}/nixos/configurations";
-    entryPoint = "${configFolder}/${name}.nix";
-    hardware = "${configFolder}/hardware/${name}.nix";
+    configFolder = "${self}/nixos";
+    entryPoint = "${configFolder}/${name}/configuration.nix";
+    hardware = "${configFolder}/${name}/hardware-configuration.nix";
   in
   {
     system = "x86_64-linux";
@@ -20,6 +20,8 @@ nixpkgs.lib.nixosSystem (
       }
       entryPoint
       hardware
-    ] ++ __attrValues self.nixosModules;
+      ../nixos/modules/flake.nix
+      ../nixos/modules/nix.nix
+    ] ++ nixpkgs.lib.optionals (extraModules != null) extraModules;
   }
 )