Compare commits

...

2 Commits

Author SHA1 Message Date
bfc1bb2da9 Use a makefile for utility snippets
All checks were successful
Check Flake / check-flake (push) Successful in 12m54s
2024-02-18 17:30:52 -07:00
0e59fa3518 Add easy boot configuration profile limit 2024-02-18 17:30:12 -07:00
8 changed files with 27 additions and 17 deletions

15
Makefile Normal file
View File

@ -0,0 +1,15 @@
# Lockfile utils
update-lockfile:
nix flake update --commit-lock-file
update-lockfile-without-commit:
nix flake update
# Agenix utils
edit-secret:
cd secrets && agenix -e $(filter-out $@,$(MAKECMDGOALS))
rekey-secrets:
cd secrets && agenix -r
# NixOS utils
clean-old-nixos-profiles:
doas nix-collect-garbage -d

View File

@ -10,6 +10,10 @@ in
device = mkOption { device = mkOption {
type = types.str; type = types.str;
}; };
configurationLimit = mkOption {
default = 20;
type = types.int;
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -19,7 +23,7 @@ in
enable = true; enable = true;
device = cfg.device; device = cfg.device;
useOSProber = true; useOSProber = true;
configurationLimit = 20; configurationLimit = cfg.configurationLimit;
theme = pkgs.nixos-grub2-theme; theme = pkgs.nixos-grub2-theme;
}; };
}; };

View File

@ -7,6 +7,10 @@ in
{ {
options.efi = { options.efi = {
enable = mkEnableOption "enable efi boot"; enable = mkEnableOption "enable efi boot";
configurationLimit = mkOption {
default = 20;
type = types.int;
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
@ -19,7 +23,7 @@ in
efiSupport = true; efiSupport = true;
useOSProber = true; useOSProber = true;
# memtest86.enable = true; # memtest86.enable = true;
configurationLimit = 20; configurationLimit = cfg.configurationLimit;
theme = pkgs.nixos-grub2-theme; theme = pkgs.nixos-grub2-theme;
}; };
}; };

View File

@ -61,6 +61,7 @@
lm_sensors lm_sensors
picocom picocom
lf lf
gnumake
]; ];
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;

View File

@ -1,4 +0,0 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p bash
nix flake update --commit-lock-file

View File

@ -16,6 +16,7 @@
bios = { bios = {
enable = true; enable = true;
device = "/dev/sda"; device = "/dev/sda";
configurationLimit = 3; # Save room in /nix/store
}; };
remoteLuksUnlock.enable = true; remoteLuksUnlock.enable = true;

View File

@ -1,5 +0,0 @@
#!/usr/bin/env bash
set -e
agenix -r
git commit . -m "Rekey secrets"

View File

@ -1,6 +0,0 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p bash
git pull
nix flake update # intentionally ignore the lockfile
sudo nixos-rebuild switch --flake .