Avoid repeated keys

This commit is contained in:
SebastianStork 2024-08-07 01:22:15 +02:00
parent 53d90bee5a
commit 94e52b022b
12 changed files with 143 additions and 114 deletions

View file

@ -6,16 +6,10 @@
checks = { checks = {
treefmt = (import ./treefmt.nix { inherit inputs pkgs; }).check self; treefmt = (import ./treefmt.nix { inherit inputs pkgs; }).check self;
statix = statix = pkgs.runCommand "statix" { buildInputs = [ pkgs.statix ]; } ''
let statix check ${self}
statix-config = pkgs.writeText "statix.toml" '' mkdir $out
disabled = ["repeated_keys"] '';
'';
in
pkgs.runCommand "statix" { buildInputs = [ pkgs.statix ]; } ''
statix check ${self} --config ${statix-config}
mkdir $out
'';
deadnix = pkgs.runCommand "deadnix" { buildInputs = [ pkgs.deadnix ]; } '' deadnix = pkgs.runCommand "deadnix" { buildInputs = [ pkgs.deadnix ]; } ''
deadnix ${self} --fail --exclude ${self}/flake/formatter.nix deadnix ${self} --fail --exclude ${self}/flake/formatter.nix

View file

@ -6,19 +6,27 @@
]; ];
nixpkgs.hostPlatform = "x86_64-linux"; nixpkgs.hostPlatform = "x86_64-linux";
hardware.enableRedistributableFirmware = true;
hardware.cpu.amd.updateMicrocode = true; hardware = {
boot.kernelModules = [ "kvm-amd" ]; enableRedistributableFirmware = true;
boot.initrd.kernelModules = [ "usb_storage" ]; cpu.amd.updateMicrocode = true;
boot.initrd.availableKernelModules = [ };
"nvme"
"xhci_pci" boot = {
"ahci" kernelModules = [ "kvm-amd" ];
"sd_mod" initrd.kernelModules = [ "usb_storage" ];
]; initrd.availableKernelModules = [
"nvme"
"xhci_pci"
"ahci"
"sd_mod"
];
};
zramSwap.enable = true; zramSwap.enable = true;
services.fstrim.enable = true; services = {
services.fwupd.enable = true; fstrim.enable = true;
services.auto-cpufreq.enable = true; fwupd.enable = true;
auto-cpufreq.enable = true;
};
} }

View file

@ -12,21 +12,27 @@
]; ];
nixpkgs.hostPlatform = "x86_64-linux"; nixpkgs.hostPlatform = "x86_64-linux";
hardware.enableRedistributableFirmware = true;
hardware.cpu.amd.updateMicrocode = true; hardware = {
boot.kernelModules = [ enableRedistributableFirmware = true;
"kvm-amd" cpu.amd.updateMicrocode = true;
"k10temp" };
"nct6775"
]; boot = {
boot.initrd.availableKernelModules = [ kernelModules = [
"xhci_pci" "kvm-amd"
"ahci" "k10temp"
"nvme" "nct6775"
"usb_storage" ];
"usbhid" initrd.availableKernelModules = [
"sd_mod" "xhci_pci"
]; "ahci"
"nvme"
"usb_storage"
"usbhid"
"sd_mod"
];
};
zramSwap.enable = true; zramSwap.enable = true;
services.fstrim.enable = true; services.fstrim.enable = true;

View file

@ -3,18 +3,22 @@
options.myConfig.git.enable = lib.mkEnableOption ""; options.myConfig.git.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.git.enable { config = lib.mkIf config.myConfig.git.enable {
programs.git = {
enable = true;
userName = "SebastianStork";
userEmail = "sebastian.stork@pm.me";
extraConfig.init.defaultBranch = "main";
};
programs.lazygit.enable = true;
sops.secrets.github-ssh-key.path = "${config.home.homeDirectory}/.ssh/github"; sops.secrets.github-ssh-key.path = "${config.home.homeDirectory}/.ssh/github";
programs.ssh = {
enable = true; programs = {
matchBlocks."github.com".identityFile = "~/.ssh/github"; git = {
enable = true;
userName = "SebastianStork";
userEmail = "sebastian.stork@pm.me";
extraConfig.init.defaultBranch = "main";
};
lazygit.enable = true;
ssh = {
enable = true;
matchBlocks."github.com".identityFile = "~/.ssh/github";
};
}; };
}; };
} }

View file

@ -8,48 +8,50 @@
options.myConfig.shell.zsh.enable = lib.mkEnableOption ""; options.myConfig.shell.zsh.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.shell.zsh.enable { config = lib.mkIf config.myConfig.shell.zsh.enable {
programs.zsh = { programs = {
enable = true; zsh = {
dotDir = ".config/zsh"; enable = true;
dotDir = ".config/zsh";
autocd = true; autocd = true;
autosuggestion.enable = true; autosuggestion.enable = true;
syntaxHighlighting.enable = true; syntaxHighlighting.enable = true;
history = { history = {
ignoreAllDups = true; ignoreAllDups = true;
path = "${config.xdg.dataHome}/zsh/zsh_history"; path = "${config.xdg.dataHome}/zsh/zsh_history";
};
plugins = [
{
name = "fzf-tab";
src = pkgs.zsh-fzf-tab;
file = "share/fzf-tab/fzf-tab.plugin.zsh";
}
];
initExtra = ''
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-Z}'
zstyle ':completion:*' list-colors ''${(s.:.)LS_COLORS}
zstyle ':completion:*' menu no
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls $realpath'
bindkey "^[[1;5D" backward-word
bindkey "^[[1;5C" forward-word
'';
}; };
plugins = [ fzf.enable = true;
{
name = "fzf-tab";
src = pkgs.zsh-fzf-tab;
file = "share/fzf-tab/fzf-tab.plugin.zsh";
}
];
initExtra = '' zoxide = {
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-Z}' enable = true;
zstyle ':completion:*' list-colors ''${(s.:.)LS_COLORS} options = [ "--cmd cd" ];
zstyle ':completion:*' menu no };
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls $realpath'
bindkey "^[[1;5D" backward-word direnv = {
bindkey "^[[1;5C" forward-word enable = true;
''; nix-direnv.enable = true;
}; config.global.hide_env_diff = true;
};
programs.fzf.enable = true;
programs.zoxide = {
enable = true;
options = [ "--cmd cd" ];
};
programs.direnv = {
enable = true;
nix-direnv.enable = true;
config.global.hide_env_diff = true;
}; };
}; };
} }

View file

@ -3,11 +3,13 @@
options.myConfig.auto-gc.enable = lib.mkEnableOption ""; options.myConfig.auto-gc.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.auto-gc.enable { config = lib.mkIf config.myConfig.auto-gc.enable {
programs.nh.enable = true; programs.nh = {
programs.nh.clean = {
enable = true; enable = true;
dates = "daily"; clean = {
extraArgs = "--keep 10 --keep-since 3d"; enable = true;
dates = "daily";
extraArgs = "--keep 10 --keep-since 3d";
};
}; };
}; };
} }

View file

@ -3,11 +3,14 @@
options.myConfig.bluetooth.enable = lib.mkEnableOption ""; options.myConfig.bluetooth.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.bluetooth.enable { config = lib.mkIf config.myConfig.bluetooth.enable {
hardware.bluetooth = { hardware = {
enable = true; bluetooth = {
powerOnBoot = true; enable = true;
powerOnBoot = true;
};
logitech.wireless.enable = true;
}; };
services.blueman.enable = true; services.blueman.enable = true;
hardware.logitech.wireless.enable = true;
}; };
} }

View file

@ -3,15 +3,17 @@
options.myConfig.boot.loader.systemd-boot.enable = lib.mkEnableOption ""; options.myConfig.boot.loader.systemd-boot.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.boot.loader.systemd-boot.enable { config = lib.mkIf config.myConfig.boot.loader.systemd-boot.enable {
boot.tmp.cleanOnBoot = true; boot = {
boot.loader = { tmp.cleanOnBoot = true;
systemd-boot = { loader = {
enable = true; systemd-boot = {
editor = false; enable = true;
configurationLimit = 20; editor = false;
configurationLimit = 20;
};
efi.canTouchEfiVariables = true;
timeout = 0;
}; };
efi.canTouchEfiVariables = true;
timeout = 0;
}; };
systemd.watchdog.rebootTime = "10"; systemd.watchdog.rebootTime = "10";
}; };

View file

@ -10,9 +10,11 @@
"rd.udev.log_level=3" "rd.udev.log_level=3"
"udev.log_priority=3" "udev.log_priority=3"
]; ];
initrd = {
verbose = false;
systemd.enable = true;
};
consoleLogLevel = 3; consoleLogLevel = 3;
initrd.verbose = false;
initrd.systemd.enable = true;
plymouth.enable = true; plymouth.enable = true;
}; };
}; };

View file

@ -13,8 +13,10 @@ in
options.myConfig.comma.enable = lib.mkEnableOption ""; options.myConfig.comma.enable = lib.mkEnableOption "";
config = { config = {
programs.command-not-found.enable = !cfg.enable; programs = {
programs.nix-index.enable = cfg.enable; command-not-found.enable = !cfg.enable;
programs.nix-index-database.comma.enable = cfg.enable; nix-index.enable = cfg.enable;
nix-index-database.comma.enable = cfg.enable;
};
}; };
} }

View file

@ -3,11 +3,13 @@
options.myConfig.printing.enable = lib.mkEnableOption ""; options.myConfig.printing.enable = lib.mkEnableOption "";
config = lib.mkIf config.myConfig.printing.enable { config = lib.mkIf config.myConfig.printing.enable {
services.printing.enable = true; services = {
services.avahi = { printing.enable = true;
enable = true; avahi = {
nssmdns4 = true; enable = true;
openFirewall = true; nssmdns4 = true;
openFirewall = true;
};
}; };
}; };
} }

View file

@ -8,9 +8,11 @@
services.pipewire = { services.pipewire = {
enable = true; enable = true;
wireplumber.enable = true; wireplumber.enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true; pulse.enable = true;
alsa = {
enable = true;
support32Bit = true;
};
}; };
}; };
} }