ctucx.git: nixfiles

ctucx' nixfiles

commit a3773bfded028e63b0783f184fe425b6d883d1de
parent 3b1200e8878e6c448831795f6416965314d36a4b
Author: Leah (ctucx) <leah@ctu.cx>
Date: Fri, 19 Aug 2022 12:51:28 +0200

darwin/systemEnvironment: unify configuration for all darwin-hosts
3 files changed, 39 insertions(+), 53 deletions(-)
A
configurations/darwin/systemEnvironment.nix
|
34
++++++++++++++++++++++++++++++++++
M
machines/blechbuechse/darwin-configuration.nix
|
26
++------------------------
M
machines/blechkasten/darwin-configuration.nix
|
32
+++-----------------------------
diff --git a/configurations/darwin/systemEnvironment.nix b/configurations/darwin/systemEnvironment.nix
@@ -0,0 +1,34 @@
+{ config, pkgs, lib, ... }:
+
+let
+  bgiparser = pkgs.callPackage ../../pkgs/bgiparser.nix {};
+  asitop    = pkgs.callPackage ../../pkgs/asitop.nix {};
+
+in {
+
+  nix = {
+    package = pkgs.nix;
+    extraOptions = ''
+      experimental-features = nix-command
+    '';
+  };
+  services.nix-daemon.enable = true;
+
+  home-manager = {
+    useUserPackages = true;
+
+    users.leah.home.packages      = [ bgiparser asitop ];
+    users.leah.home.homeDirectory = lib.mkForce "/Users/leah/";
+  };
+
+  environment = {
+    darwinConfig   = "\$HOME/nixfiles/darwin-configuration.nix";
+    loginShell     = "${pkgs.bashInteractive}/bin/bash";
+    shells         = [ pkgs.bashInteractive ];
+    systemPackages = with pkgs; [
+      bashInteractive
+      (pkgs.callPackage <agenix/pkgs/agenix.nix> {})
+    ];
+  };
+
+}
diff --git a/machines/blechbuechse/darwin-configuration.nix b/machines/blechbuechse/darwin-configuration.nix
@@ -1,10 +1,6 @@
 { config, pkgs, lib, ... }:
 
-let
-  bgiparser = pkgs.callPackage ../../pkgs/bgiparser.nix {};
-  asitop    = pkgs.callPackage ../../pkgs/asitop.nix {};
-
-in {
+{
 
   imports = [
     <home-manager/nix-darwin>

@@ -40,27 +36,9 @@ in {
     ./syncthing.nix
   ];
 
-  nix.package = pkgs.nix;
-  services.nix-daemon.enable = true;
-
-  home-manager = {
-    useUserPackages = true;
-
-    users.leah.home.packages      = [ bgiparser asitop ];
-    users.leah.home.homeDirectory = lib.mkForce "/Users/leah/";
-  };
-
-  environment = {
-    darwinConfig   = "\$HOME/nixfiles/darwin-configuration.nix";
-    loginShell     = "${pkgs.bashInteractive}/bin/bash";
-    shells         = [ pkgs.bashInteractive ];
-    systemPackages = with pkgs; [
-      bashInteractive
-    ];
-  };
-
   networking.hostName     = "blechbuechse";
   networking.computerName = config.networking.hostName;
 
   system.stateVersion = 4;
+
 }
diff --git a/machines/blechkasten/darwin-configuration.nix b/machines/blechkasten/darwin-configuration.nix
@@ -1,10 +1,6 @@
 { config, pkgs, lib, ... }:
 
-let
-  bgiparser = pkgs.callPackage ../../pkgs/bgiparser.nix {};
-  asitop    = pkgs.callPackage ../../pkgs/asitop.nix {};
-
-in {
+{
 
   imports = [
     <home-manager/nix-darwin>

@@ -13,6 +9,7 @@ in {
     ../../helpers/make-nixpkgs.nix
 
     ../../configurations/darwin/nixpkgs-overrides.nix
+    ../../configurations/darwin/systemEnvironment.nix
     ../../configurations/darwin/systemSettings.nix
     ../../configurations/darwin/appSettings.nix
     ../../configurations/darwin/keyboard.nix

@@ -40,32 +37,9 @@ in {
     ./syncthing.nix
   ];
 
-  nix = {
-    package = pkgs.nix;
-    extraOptions = ''
-      experimental-features = nix-command
-    '';
-  };
-  services.nix-daemon.enable = true;
-
-  home-manager = {
-    useUserPackages = true;
-
-    users.leah.home.packages      = [ bgiparser asitop ];
-    users.leah.home.homeDirectory = lib.mkForce "/Users/leah/";
-  };
-
-  environment = {
-    darwinConfig   = "\$HOME/nixfiles/darwin-configuration.nix";
-    loginShell     = "${pkgs.bashInteractive}/bin/bash";
-    shells         = [ pkgs.bashInteractive ];
-    systemPackages = with pkgs; [
-      bashInteractive
-    ];
-  };
-
   networking.hostName     = "blechkasten";
   networking.computerName = config.networking.hostName;
 
   system.stateVersion = 4;
+
 }