Skip to content

Commit 9ace03a

Browse files
committedMar 19, 2024
reformat with nixfmt
1 parent d8aa2b1 commit 9ace03a

20 files changed

+437
-327
lines changed
 

‎flake.nix

+67-31
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
description = "NixOS configuration with flakes";
33

44
nixConfig.extra-substituters = [ "https://cache.thalheim.io" ];
5-
nixConfig.extra-trusted-public-keys = [ "cache.thalheim.io-1:R7msbosLEZKrxk/lKxf9BTjOOH7Ax3H0Qj0/6wiHOgc=" ];
5+
nixConfig.extra-trusted-public-keys = [
6+
"cache.thalheim.io-1:R7msbosLEZKrxk/lKxf9BTjOOH7Ax3H0Qj0/6wiHOgc="
7+
];
68

79
# To update all inputs:
810
# $ nix flake update
@@ -66,8 +68,8 @@
6668
srvos.url = "github:numtide/srvos";
6769
srvos.inputs.nixpkgs.follows = "nixpkgs";
6870

69-
clan-core.url = "git+https://git.clan.lol/clan/clan-core";
70-
#clan-core.url = "git+file:///home/joerg/work/clan/clan-core?ref=openssh";
71+
#clan-core.url = "git+https://git.clan.lol/clan/clan-core";
72+
clan-core.url = "git+file:///home/joerg/work/clan/clan-core?ref=openssh";
7173
clan-core.inputs.nixpkgs.follows = "nixpkgs";
7274
clan-core.inputs.sops-nix.follows = "sops-nix";
7375
clan-core.inputs.treefmt-nix.follows = "treefmt-nix";
@@ -112,10 +114,16 @@
112114
#microvm.inputs.flake-utils.follows = "flake-utils";
113115
};
114116

115-
outputs = inputs @ { self, flake-parts, nixpkgs, ... }:
116-
(flake-parts.lib.evalFlakeModule
117-
{ inherit inputs; }
118-
({ withSystem, config, ... }: {
117+
outputs =
118+
inputs@{
119+
self,
120+
flake-parts,
121+
nixpkgs,
122+
...
123+
}:
124+
(flake-parts.lib.evalFlakeModule { inherit inputs; } (
125+
{ withSystem, config, ... }:
126+
{
119127
imports = [
120128
./nixos/flake-module.nix
121129
./nixos/images/flake-module.nix
@@ -124,34 +132,62 @@
124132
./devshell/flake-module.nix
125133
inputs.hercules-ci-effects.flakeModule
126134
];
127-
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" ];
135+
systems = [
136+
"x86_64-linux"
137+
"aarch64-linux"
138+
"aarch64-darwin"
139+
];
128140

129141
herculesCI = herculesCI: {
130-
onPush.default.outputs.effects.deploy = withSystem config.defaultEffectSystem ({ pkgs, hci-effects, ... }:
131-
hci-effects.runIf (herculesCI.config.repo.branch == "main") (hci-effects.mkEffect {
132-
effectScript = ''
133-
${pkgs.hello}/bin/hello
134-
'';
135-
})
142+
onPush.default.outputs.effects.deploy = withSystem config.defaultEffectSystem (
143+
{ pkgs, hci-effects, ... }:
144+
hci-effects.runIf (herculesCI.config.repo.branch == "main") (
145+
hci-effects.mkEffect {
146+
effectScript = ''
147+
${pkgs.hello}/bin/hello
148+
'';
149+
}
150+
)
136151
);
137152
};
138153

139-
perSystem = { config, inputs', self', lib, system, ... }: {
140-
# make pkgs available to all `perSystem` functions
141-
_module.args.pkgs = inputs'.nixpkgs.legacyPackages;
142-
143-
formatter = config.treefmt.build.wrapper;
144-
145-
checks =
146-
let
147-
nixosMachines = lib.mapAttrs' (name: config: lib.nameValuePair "nixos-${name}" config.config.system.build.toplevel) ((lib.filterAttrs (_: config: config.pkgs.system == system)) self.nixosConfigurations);
148-
blacklistPackages = [ "install-iso" "nspawn-template" "netboot-pixie-core" "netboot" ];
149-
packages = lib.mapAttrs' (n: lib.nameValuePair "package-${n}") (lib.filterAttrs (n: _v: !(builtins.elem n blacklistPackages)) self'.packages);
150-
devShells = lib.mapAttrs' (n: lib.nameValuePair "devShell-${n}") self'.devShells;
151-
homeConfigurations = lib.mapAttrs' (name: config: lib.nameValuePair "home-manager-${name}" config.activation-script) (self'.legacyPackages.homeConfigurations or { });
152-
in
153-
nixosMachines // packages // devShells // homeConfigurations;
154-
};
154+
perSystem =
155+
{
156+
config,
157+
inputs',
158+
self',
159+
lib,
160+
system,
161+
...
162+
}:
163+
{
164+
# make pkgs available to all `perSystem` functions
165+
_module.args.pkgs = inputs'.nixpkgs.legacyPackages;
166+
167+
formatter = config.treefmt.build.wrapper;
168+
169+
checks =
170+
let
171+
nixosMachines = lib.mapAttrs' (
172+
name: config: lib.nameValuePair "nixos-${name}" config.config.system.build.toplevel
173+
) ((lib.filterAttrs (_: config: config.pkgs.system == system)) self.nixosConfigurations);
174+
blacklistPackages = [
175+
"install-iso"
176+
"nspawn-template"
177+
"netboot-pixie-core"
178+
"netboot"
179+
];
180+
packages = lib.mapAttrs' (n: lib.nameValuePair "package-${n}") (
181+
lib.filterAttrs (n: _v: !(builtins.elem n blacklistPackages)) self'.packages
182+
);
183+
devShells = lib.mapAttrs' (n: lib.nameValuePair "devShell-${n}") self'.devShells;
184+
homeConfigurations = lib.mapAttrs' (
185+
name: config: lib.nameValuePair "home-manager-${name}" config.activation-script
186+
) (self'.legacyPackages.homeConfigurations or { });
187+
in
188+
nixosMachines // packages // devShells // homeConfigurations;
189+
};
155190
# CI
156-
})).config.flake;
191+
}
192+
)).config.flake;
157193
}

‎home-manager/bernie.nix

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
{ ... }: {
2-
imports = [
3-
./common.nix
4-
];
1+
{ ... }:
2+
{
3+
imports = [ ./common.nix ];
54
services.syncthing.enable = true;
65
}

‎home-manager/common.nix

+15-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
1-
{ pkgs
2-
, config
3-
, lib
4-
, ...
5-
}: {
1+
{
2+
pkgs,
3+
config,
4+
lib,
5+
...
6+
}:
7+
{
68
imports = [
79
./modules/neovim
810
./modules/tmux-thumbs.nix
911
];
10-
home.packages = with pkgs;
12+
home.packages =
13+
with pkgs;
1114
[
1215
nixpkgs-review
1316
nix-prefetch
@@ -57,12 +60,14 @@
5760
ncurses
5861
coreutils
5962
git
60-
] ++ lib.optionals pkgs.stdenv.isLinux [
63+
]
64+
++ lib.optionals pkgs.stdenv.isLinux [
6165
strace
6266
psmisc
6367
glibcLocales
6468
gdb
65-
] ++ lib.optional (pkgs.hostPlatform.system != "riscv64-linux") nix-output-monitor;
69+
]
70+
++ lib.optional (pkgs.hostPlatform.system != "riscv64-linux") nix-output-monitor;
6671

6772
home.enableNixpkgsReleaseCheck = false;
6873

@@ -73,6 +78,7 @@
7378

7479
home.stateVersion = "23.11";
7580
home.username = lib.mkDefault "joerg";
76-
home.homeDirectory = if pkgs.stdenv.isDarwin then "/Users/${config.home.username}" else "/home/${config.home.username}";
81+
home.homeDirectory =
82+
if pkgs.stdenv.isDarwin then "/Users/${config.home.username}" else "/home/${config.home.username}";
7783
programs.home-manager.enable = true;
7884
}

‎home-manager/config.nix

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
{ nurFun ? (import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz")), ... }: {
1+
{
2+
nurFun ? (
3+
import (builtins.fetchTarball "https://github.com/nix-community/NUR/archive/master.tar.gz")
4+
),
5+
...
6+
}:
7+
{
28
allowUnfree = true;
39
# https://github.com/nix-community/home-manager/issues/2942
410
allowUnfreePredicate = _pkg: true;

0 commit comments

Comments
 (0)
Please sign in to comment.