summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2022-03-10 23:33:18 -0600
committerAlejandro Soto <alejandro@34project.org>2022-03-10 23:40:01 -0600
commit1f0b119fac141d362094740328ce5f60dd47ad28 (patch)
treea4caa724a3924b246882d7cecfd6445f70995ee3
parente287d00e96b5505da20399d073ae96458f841397 (diff)
Add sys and home platform dirs
-rw-r--r--flake.nix45
-rw-r--r--home/default.nix4
-rw-r--r--home/platform/README.md1
-rw-r--r--platform/p-user.nix35
-rw-r--r--platform/user.nix46
-rw-r--r--sys/platform/README.md1
6 files changed, 32 insertions, 100 deletions
diff --git a/flake.nix b/flake.nix
index 660ee66..65941a9 100644
--- a/flake.nix
+++ b/flake.nix
@@ -11,8 +11,9 @@
nur.url = "github:nix-community/NUR";
};
- outputs = { self, nixpkgs, home-manager, nur, ... }: let
+ outputs = { self, nixpkgs, home-manager, nur, ... }: with nixpkgs.lib; let
util = import ./util;
+ inherit (util nixpkgs.lib) importAll;
pkgSet = pkgs: import ./pkgs {
inherit pkgs;
@@ -26,30 +27,38 @@
};
nixosConfigurations = with nixpkgs.lib; let
- hostUtil = util nixpkgs.lib;
hostConfig = host: (makeOverridable nixosSystem) {
system = "x86_64-linux";
modules = [ (import ./sys self) host ];
};
- in mapAttrs (_: hostConfig) (hostUtil.importAll { root = ./platform; });
+ in mapAttrs (_: hostConfig) (importAll { root = ./sys/platform; });
- homeConfigurations."ale@p-user" = home-manager.lib.homeManagerConfiguration {
- system = "x86_64-linux";
- configuration = {
- imports = [ ./home ];
- nixpkgs.overlays = [ nur.overlay self.overlay ];
- };
+ homeConfigurations = let
+ home = platform: home-manager.lib.homeManagerConfiguration {
+ system = "x86_64-linux";
- username = "ale";
- homeDirectory = "/home/ale";
+ configuration = import ./home;
+ extraModules = [ platform ];
- # Update the state version as needed.
- # See the changelog here:
- # https://nix-community.github.io/home-manager/release-notes.html#sec-release-21.05
- stateVersion = "21.11";
+ username = "ale";
+ homeDirectory = "/home/ale";
- # Optionally use extraSpecialArgs
- # to pass through arguments to home.nix
- };
+ # Update the state version as needed.
+ # See the changelog here:
+ # https://nix-community.github.io/home-manager/release-notes.html#sec-release-21.05
+ stateVersion = "21.11";
+
+ # Optionally use extraSpecialArgs
+ # to pass through arguments to home.nix
+ extraSpecialArgs = {
+ inherit nur self;
+ };
+ };
+
+ homeConfig = id: platform: {
+ name = "ale@${id}";
+ value = home platform;
+ };
+ in mapAttrs' homeConfig (importAll { root = ./home/platform; });
};
}
diff --git a/home/default.nix b/home/default.nix
index b70ae6f..d3ad8ac 100644
--- a/home/default.nix
+++ b/home/default.nix
@@ -1,6 +1,8 @@
-{ lib, config, pkgs, ... }: {
+{ lib, config, pkgs, nur, self, ... }: {
imports = [ ./unfree.nix ];
+ nixpkgs.overlays = [ nur.overlay self.overlay ];
+
nix.registry."system".to = {
type = "path";
path = "/home/ale/nix";
diff --git a/home/platform/README.md b/home/platform/README.md
new file mode 100644
index 0000000..37073ba
--- /dev/null
+++ b/home/platform/README.md
@@ -0,0 +1 @@
+# This directory has been lustrated.
diff --git a/platform/p-user.nix b/platform/p-user.nix
deleted file mode 100644
index 7625355..0000000
--- a/platform/p-user.nix
+++ /dev/null
@@ -1,35 +0,0 @@
-{
- config = {
- hostname = "p-user";
- portable = true;
-
- dhcpInterface = "enp5s0";
-
- canTouchEfiVariables = false;
- initrdModules = [ "xhci_pci" "ahci" "usb_storage" "uas" "sd_mod" "r8169" ];
-
- videoDrivers = [ "amdgpu" ];
-
- crypt.toplevel = {
- device = "/dev/hdd0/user.crypt";
- target = "user-portable";
- headerFromBoot = "tierra/trust/hdd0-user.luks-header";
- };
-
- fs = {
- boot.device = "/dev/disk/by-uuid/F8F9-1F8A";
-
- sys = {
- device = "/dev/mapper/user-portable";
- ssd = false;
- root = "/run/nixroot";
- toplevel = "/run";
- };
-
- hdd = {
- device = "/dev/mapper/user-portable";
- home = "/run/home";
- };
- };
- };
-}
diff --git a/platform/user.nix b/platform/user.nix
deleted file mode 100644
index dc5961a..0000000
--- a/platform/user.nix
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- config.local = {
- hostname = "user";
- portable = false;
-
- dhcpInterface = "ens8";
-
- canTouchEfiVariables = true;
- initrdModules = ,[ "xhci_pci" "ahci" "usb_storage" "uas" "sd_mod" "r8169" ];
-
- videoDrivers = [ "qxl" ];
-
- crypt = {
- toplevel = {
- device = "/dev/disk/by-path/virtio-pci-0000:00:05.0";
- target = "user";
- headerFromBoot = "headers/toplevel0-user.luks-header";
- };
-
- aux = [
- {
- device = "/dev/disk/by-path/virtio-pci-0000:00:0b.0";
- target = "user-hdd";
- header = "/var/trust/headers/hdd1-user.luks-header";
- keyfile = "/var/trust/cryptkeys/hdd1-user.luks-key";
- }
- ];
- };
-
- fs = {
- boot.device = "/dev/disk/by-uuid/";
-
- sys = {
- device = "/dev/mapper/user";
- ssd = true;
- root = "/root";
- toplevel = "/";
- };
-
- hdd = {
- device = "/dev/mapper/user-hdd";
- home = "/home";
- };
- };
- };
-}
diff --git a/sys/platform/README.md b/sys/platform/README.md
new file mode 100644
index 0000000..37073ba
--- /dev/null
+++ b/sys/platform/README.md
@@ -0,0 +1 @@
+# This directory has been lustrated.