This repository was archived by the owner on Jun 7, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +74
-40
lines changed Expand file tree Collapse file tree 6 files changed +74
-40
lines changed Original file line number Diff line number Diff line change 69
69
} ) ;
70
70
mkNixOSConfig = host : import ./system ( inputs // { conf = importHostConf host ; } ) ;
71
71
in {
72
- nixosConfigurations = builtins . listToAttrs ( map ( host : {
73
- name = host ;
74
- value = mkNixOSConfig host ;
75
- } )
76
- hosts ) ;
72
+ nixosConfigurations = builtins . listToAttrs ( lib . flatten ( map ( host : let
73
+ config = mkNixOSConfig host ;
74
+ in [
75
+ {
76
+ name = host ;
77
+ value = config . full ;
78
+ }
79
+ {
80
+ name = "${ host } -base" ;
81
+ value = config . base ;
82
+ }
83
+ ] )
84
+ hosts ) ) ;
77
85
packages = eachDefaultSystem (
78
86
system : let
79
87
pkgs = import nixpkgs { inherit system ; } ;
Original file line number Diff line number Diff line change
1
+ { pkgs , ...} : {
2
+ users . mutableUsers = false ;
3
+ users . users . root . password = "nixos" ;
4
+
5
+ environment . systemPackages = with pkgs ; [
6
+ vim
7
+ git
8
+ ] ;
9
+ }
Original file line number Diff line number Diff line change 1
1
{
2
+ conf ,
2
3
nixpkgs ,
3
4
pkgs ,
4
5
...
12
13
${ pkgs . buildPackages . ckbcomp } /bin/ckbcomp -layout de -option ctrl:swapcaps -variant nodeadkeys > $out
13
14
'' ;
14
15
16
+ networking . hostName = conf . hostname ;
17
+ networking . networkmanager = {
18
+ enable = true ;
19
+ wifi . macAddress = "random" ;
20
+ ethernet . macAddress = "random" ;
21
+ } ;
22
+
15
23
programs . zsh . enable = true ;
16
24
users . defaultUserShell = pkgs . zsh ;
17
25
18
- environment . variables = {
19
- EDITOR = "hx" ;
20
- VISUAL = "hx" ;
21
- } ;
22
-
23
26
environment . systemPackages = with pkgs ; [
24
27
age
25
28
comma
Original file line number Diff line number Diff line change 19
19
} ) ( filterAttrs ( k : _ : hasPrefix "nixpkgs-" k ) inputs ) ;
20
20
21
21
specialArgs = inputs // extra-pkgs ;
22
- in
23
- nixpkgs . lib . nixosSystem rec {
22
+ in {
23
+ base = nixpkgs . lib . nixosSystem {
24
+ inherit system pkgs specialArgs ;
25
+ modules = [
26
+ ./common.nix
27
+ conf . extraConfig
28
+ conf . hardware-configuration
29
+
30
+ ./base.nix
31
+ ./boot.nix
32
+ ./filesystems.nix
33
+ ] ;
34
+ } ;
35
+
36
+ full = nixpkgs . lib . nixosSystem {
24
37
inherit system pkgs specialArgs ;
25
38
modules = [
26
39
./common.nix
33
46
./boot.nix
34
47
./borg.nix
35
48
./emulation.nix
49
+ ./env.nix
36
50
./filesystems.nix
37
51
./fonts.nix
38
52
./geoclue2.nix
58
72
} ;
59
73
}
60
74
] ;
61
- }
75
+ } ;
76
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ environment . variables = {
3
+ EDITOR = "hx" ;
4
+ VISUAL = "hx" ;
5
+ } ;
6
+ }
Original file line number Diff line number Diff line change 3
3
pkgs ,
4
4
...
5
5
} : {
6
- networking . hostName = conf . hostname ;
6
+ networking . networkmanager . dispatcherScripts = [
7
+ {
8
+ type = "basic" ;
9
+ source = let
10
+ inherit ( conf . networking ) vpn ;
11
+ wifi . trusted = builtins . toFile "wifi-trusted" ( builtins . foldl' ( acc : x : "${ acc } ${ x } \n " ) "" conf . networking . wifi . trusted ) ;
12
+ in
13
+ pkgs . writeText "trusted-networks" ''
14
+ export PATH=${ pkgs . lib . makeBinPath ( with pkgs ; [ coreutils gnugrep networkmanager ] ) }
7
15
8
- networking . networkmanager = {
9
- enable = true ;
10
- wifi . macAddress = "random" ;
11
- ethernet . macAddress = "random" ;
12
- dispatcherScripts = [
13
- {
14
- type = "basic" ;
15
- source = let
16
- inherit ( conf . networking ) vpn ;
17
- wifi . trusted = builtins . toFile "wifi-trusted" ( builtins . foldl' ( acc : x : "${ acc } ${ x } \n " ) "" conf . networking . wifi . trusted ) ;
18
- in
19
- pkgs . writeText "trusted-networks" ''
20
- export PATH=${ pkgs . lib . makeBinPath ( with pkgs ; [ coreutils gnugrep networkmanager ] ) }
21
-
22
- if [[ -z "$1" ]] || [[ "$1" = "vpn" ]]; then
23
- exit
24
- fi
16
+ if [[ -z "$1" ]] || [[ "$1" = "vpn" ]]; then
17
+ exit
18
+ fi
25
19
26
- if nmcli --fields=UUID c s --active | tail +2 | cut -d' ' -f1 | sort | comm -12 - <(sort ${ wifi . trusted } ) | grep -q .; then
27
- nmcli c up "${ vpn . default } " &
28
- else
29
- nmcli c up "${ vpn . full } " &
30
- fi
31
- '' ;
32
- }
33
- ] ;
34
- } ;
20
+ if nmcli --fields=UUID c s --active | tail +2 | cut -d' ' -f1 | sort | comm -12 - <(sort ${ wifi . trusted } ) | grep -q .; then
21
+ nmcli c up "${ vpn . default } " &
22
+ else
23
+ nmcli c up "${ vpn . full } " &
24
+ fi
25
+ '' ;
26
+ }
27
+ ] ;
35
28
36
29
networking . firewall = {
37
30
enable = true ;
You can’t perform that action at this time.
0 commit comments