diff --git a/flake.lock b/flake.lock index cc30b87..91d8cb2 100644 --- a/flake.lock +++ b/flake.lock @@ -704,6 +704,22 @@ "type": "github" } }, + "flake-compat_9": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": [ @@ -924,6 +940,21 @@ "type": "github" } }, + "flake-utils_10": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "flake-utils_2": { "locked": { "lastModified": 1642700792, @@ -1161,6 +1192,27 @@ "type": "github" } }, + "gitignore_4": { + "inputs": { + "nixpkgs": [ + "pre-commit-hooks-nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1660459072, + "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "gomod2nix": { "flake": false, "locked": { @@ -1748,6 +1800,22 @@ } }, "nixpkgs-stable_4": { + "locked": { + "lastModified": 1678872516, + "narHash": "sha256-/E1YwtMtFAu2KUQKV/1+KFuReYPANM2Rzehk84VxVoc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9b8e5abb18324c7fe9f07cb100c3cd4a29cda8b8", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-stable_5": { "locked": { "lastModified": 1681005198, "narHash": "sha256-5LrnBeXR7Hv8OXh6eany7br4qBW+ZNl4LKf1CJu9zbg=", @@ -1956,6 +2024,22 @@ } }, "nixpkgs_17": { + "locked": { + "lastModified": 1681303793, + "narHash": "sha256-JEdQHsYuCfRL2PICHlOiH/2ue3DwoxUX7DJ6zZxZXFk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "fe2ecaf706a5907b5e54d979fbde4924d84b65fc", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_18": { "locked": { "lastModified": 1680945546, "narHash": "sha256-8FuaH5t/aVi/pR1XxnF0qi4WwMYC+YxlfdsA0V+TEuQ=", @@ -1971,7 +2055,7 @@ "type": "github" } }, - "nixpkgs_18": { + "nixpkgs_19": { "locked": { "lastModified": 1680945546, "narHash": "sha256-8FuaH5t/aVi/pR1XxnF0qi4WwMYC+YxlfdsA0V+TEuQ=", @@ -2257,6 +2341,28 @@ "type": "github" } }, + "pre-commit-hooks-nix_4": { + "inputs": { + "flake-compat": "flake-compat_9", + "flake-utils": "flake-utils_10", + "gitignore": "gitignore_4", + "nixpkgs": "nixpkgs_17", + "nixpkgs-stable": "nixpkgs-stable_4" + }, + "locked": { + "lastModified": 1681831107, + "narHash": "sha256-pXl3DPhhul9NztSetUJw2fcN+RI3sGOYgKu29xpgnqw=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "b7ca8f6fff42f6af75c17f9438fed1686b7d855d", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, "pre-commit-hooks_2": { "inputs": { "flake-utils": [ @@ -2432,6 +2538,7 @@ "nixpkgs": "nixpkgs_14", "nixpkgs-wayland": "nixpkgs-wayland", "nixpkgsForNixForHydra": "nixpkgsForNixForHydra", + "pre-commit-hooks-nix": "pre-commit-hooks-nix_4", "qmk-udev-rules": "qmk-udev-rules", "radicale_infcloud": "radicale_infcloud", "rip": "rip", @@ -2462,7 +2569,7 @@ "nixpkgs": [ "nixpkgs" ], - "nixpkgs-stable": "nixpkgs-stable_4" + "nixpkgs-stable": "nixpkgs-stable_5" }, "locked": { "lastModified": 1681209176, @@ -2565,7 +2672,7 @@ }, "treefmt-nix_4": { "inputs": { - "nixpkgs": "nixpkgs_17" + "nixpkgs": "nixpkgs_18" }, "locked": { "lastModified": 1681486253, @@ -2617,7 +2724,7 @@ "xdg-desktop-portal-hyprland": { "inputs": { "hyprland-protocols": "hyprland-protocols_2", - "nixpkgs": "nixpkgs_18" + "nixpkgs": "nixpkgs_19" }, "locked": { "lastModified": 1681416853, diff --git a/flake.nix b/flake.nix index 0ccdb68..d25f4ab 100644 --- a/flake.nix +++ b/flake.nix @@ -5,6 +5,7 @@ flake-parts.url = "github:hercules-ci/flake-parts"; devshell.url = "github:numtide/devshell"; treefmt-nix.url = "github:numtide/treefmt-nix"; + pre-commit-hooks-nix.url = "github:cachix/pre-commit-hooks.nix"; nixpkgs.url = "nixpkgs/nixos-unstable"; nixos-hardware.url = "github:NixOS/nixos-hardware"; @@ -99,7 +100,7 @@ inputs.fenix.overlays.default inputs.colmena.overlay inputs.xdg-desktop-portal-hyprland.overlays.default - (self: super: { + (_: super: { # Add fonts hackNerdLigatures = super.callPackage ./pkgs/hack.nix {}; # Add the emulator @@ -144,15 +145,13 @@ imports = [ inputs.devshell.flakeModule inputs.treefmt-nix.flakeModule + inputs.pre-commit-hooks-nix.flakeModule ]; # Available systems, only x86 for now systems = ["x86_64-linux"]; perSystem = { - config, - self', - inputs', pkgs, - system, + self', ... }: { # Configure treefmt @@ -162,6 +161,11 @@ shellcheck.enable = true; shfmt.enable = true; }; + # Configure pre-commit checks + pre-commit.settings.hooks.deadnix.enable = true; + pre-commit.settings.hooks.treefmt.enable = true; + pre-commit.settings.hooks.shellcheck.enable = true; + pre-commit.settings.hooks.markdownlint.enable = true; # Load all packages from ./pkgs packages = let pkgFiles = builtins.attrNames (builtins.readDir ./pkgs); @@ -176,6 +180,7 @@ name = "dev"; packages = [ pkgs.nil + pkgs.pre-commit self'.packages.rebuild self'.packages.personal-cache self'.packages.all-hosts diff --git a/hardware/aorus.nix b/hardware/aorus.nix index ecba43e..7af43f3 100644 --- a/hardware/aorus.nix +++ b/hardware/aorus.nix @@ -1,7 +1,5 @@ { - config, lib, - pkgs, modulesPath, ... }: { diff --git a/hardware/asrock-z370-i3-black-box.nix b/hardware/asrock-z370-i3-black-box.nix index 23f07f1..3e05d0b 100644 --- a/hardware/asrock-z370-i3-black-box.nix +++ b/hardware/asrock-z370-i3-black-box.nix @@ -1,10 +1,4 @@ -{ - config, - lib, - pkgs, - modulesPath, - ... -}: let +{modulesPath, ...}: let cryptRoot.encrypted = { enable = true; blkDev = "/dev/disk/by-id/nvme-Samsung_SSD_960_PRO_512GB_S3EWNCAJ110156V-part3"; diff --git a/hardware/intel-nuc.nix b/hardware/intel-nuc.nix index c7831c0..b412dd5 100644 --- a/hardware/intel-nuc.nix +++ b/hardware/intel-nuc.nix @@ -1,5 +1,4 @@ { - config, lib, pkgs, modulesPath, diff --git a/hardware/latitude-e7440.nix b/hardware/latitude-e7440.nix index 1acb68b..558fbcb 100644 --- a/hardware/latitude-e7440.nix +++ b/hardware/latitude-e7440.nix @@ -1,7 +1,6 @@ { config, lib, - pkgs, modulesPath, ... }: { diff --git a/hardware/netcup-minimal.nix b/hardware/netcup-minimal.nix index 87060e0..b4d19e5 100644 --- a/hardware/netcup-minimal.nix +++ b/hardware/netcup-minimal.nix @@ -1,10 +1,4 @@ -{ - config, - lib, - pkgs, - modulesPath, - ... -}: { +{modulesPath, ...}: { imports = [(modulesPath + "/profiles/qemu-guest.nix")]; boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod"]; diff --git a/hardware/netcup-rs-2000-g9.nix b/hardware/netcup-rs-2000-g9.nix index 0a8c9ad..0d6e40c 100644 --- a/hardware/netcup-rs-2000-g9.nix +++ b/hardware/netcup-rs-2000-g9.nix @@ -1,7 +1,6 @@ { config, lib, - pkgs, modulesPath, ... }: { diff --git a/hardware/netcup-vps-200-g10.nix b/hardware/netcup-vps-200-g10.nix index b4d8406..064cd79 100644 --- a/hardware/netcup-vps-200-g10.nix +++ b/hardware/netcup-vps-200-g10.nix @@ -1,10 +1,4 @@ -{ - config, - lib, - pkgs, - modulesPath, - ... -}: { +{modulesPath, ...}: { imports = [(modulesPath + "/profiles/qemu-guest.nix")]; boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod"]; diff --git a/hardware/steam-deck.nix b/hardware/steam-deck.nix index 2bf4491..dd24d8e 100644 --- a/hardware/steam-deck.nix +++ b/hardware/steam-deck.nix @@ -4,7 +4,6 @@ { config, lib, - pkgs, modulesPath, ... }: { diff --git a/hardware/thinkpad-p1-gen3.nix b/hardware/thinkpad-p1-gen3.nix index 554dce1..f3b1b1f 100644 --- a/hardware/thinkpad-p1-gen3.nix +++ b/hardware/thinkpad-p1-gen3.nix @@ -2,7 +2,6 @@ config, lib, pkgs, - modulesPath, ... }: { boot = { diff --git a/modules/7-days-to-die.nix b/modules/7-days-to-die.nix index 0781f3a..0192d5f 100644 --- a/modules/7-days-to-die.nix +++ b/modules/7-days-to-die.nix @@ -1,5 +1,4 @@ { - pkgs, lib, config, ... diff --git a/modules/base-system.nix b/modules/base-system.nix index 595a56f..dd10517 100644 --- a/modules/base-system.nix +++ b/modules/base-system.nix @@ -42,7 +42,7 @@ in { # Allow joypixels' license and unfree licenses in general nixpkgs.config = { # TODO: Fix once allowUnfree works for home-manager again - allowUnfreePredicate = pkg: true; + allowUnfreePredicate = _: true; joypixels.acceptLicense = true; }; # This includes the firmware, oc diff --git a/modules/nginx-reverse-proxy.nix b/modules/nginx-reverse-proxy.nix index c056efd..c3ce1b6 100644 --- a/modules/nginx-reverse-proxy.nix +++ b/modules/nginx-reverse-proxy.nix @@ -1,4 +1,4 @@ -{pkgs, ...}: { +_: { security.acme.defaults.email = "malte.tammena@pm.me"; security.acme.acceptTerms = true; diff --git a/modules/radicale.nix b/modules/radicale.nix index 7cb9457..0803fef 100644 --- a/modules/radicale.nix +++ b/modules/radicale.nix @@ -1,6 +1,5 @@ { config, - pkgs, lib, ... }: let diff --git a/modules/restic.nix b/modules/restic.nix index b9b98f8..64dd92f 100644 --- a/modules/restic.nix +++ b/modules/restic.nix @@ -1,5 +1,4 @@ { - pkgs, lib, config, ... diff --git a/modules/taskserver.nix b/modules/taskserver.nix index 429a5f5..1a9a96e 100644 --- a/modules/taskserver.nix +++ b/modules/taskserver.nix @@ -1,5 +1,4 @@ { - pkgs, lib, config, ... diff --git a/overlays/cataclysm-dda.nix b/overlays/cataclysm-dda.nix index fc7976a..254853b 100644 --- a/overlays/cataclysm-dda.nix +++ b/overlays/cataclysm-dda.nix @@ -1,4 +1,4 @@ -self: super: let +_self: super: let lock = builtins.fromJSON (builtins.readFile ../flake.lock); in { cataclysm-dda-git = @@ -8,5 +8,5 @@ in { inherit (lock.nodes.cataclysm-dda.locked) rev; sha256 = lock.nodes.cataclysm-dda.locked.narHash; }) - .overrideAttrs (old: {enableParallelBuilding = true;}); + .overrideAttrs (_old: {enableParallelBuilding = true;}); } diff --git a/overlays/fzf-kak.nix b/overlays/fzf-kak.nix index fa1cfd5..6d20cca 100644 --- a/overlays/fzf-kak.nix +++ b/overlays/fzf-kak.nix @@ -1,6 +1,6 @@ -self: super: { +_self: super: { kakounePlugins = super.lib.recursiveUpdate super.kakounePlugins { - fzf-kak = super.kakounePlugins.fzf-kak.overrideAttrs (old: { + fzf-kak = super.kakounePlugins.fzf-kak.overrideAttrs (_old: { version = "95b12b1fe93c6db0441c61062823231a28eed037"; src = super.fetchFromGitHub { owner = "andreyorst"; diff --git a/overlays/logisim.nix b/overlays/logisim.nix index bac44dc..c79a063 100644 --- a/overlays/logisim.nix +++ b/overlays/logisim.nix @@ -1,7 +1,7 @@ -self: super: let +_self: super: let font-flags = "-Dawt.useSystemAAFontSettings=lcd -Dswing.aatext=true"; in { - logisim = super.logisim.overrideAttrs (old: { + logisim = super.logisim.overrideAttrs (_old: { pname = "logisim-evolution"; src = super.fetchurl { url = "https://mathcs.holycross.edu/~kwalsh/logisim-evolution-4.0.4hc.jar"; diff --git a/overlays/prometheus-fritzbox-exporter.nix b/overlays/prometheus-fritzbox-exporter.nix index 71122c3..6b44989 100644 --- a/overlays/prometheus-fritzbox-exporter.nix +++ b/overlays/prometheus-fritzbox-exporter.nix @@ -1,4 +1,4 @@ -self: super: { +_self: super: { prometheus-fritzbox-exporter = super.buildGoModule { pname = "fritzbox-exporter"; version = "git-6b8ced0"; diff --git a/overlays/qmk-udev-rules.nix b/overlays/qmk-udev-rules.nix index 4da8364..165d9cd 100644 --- a/overlays/qmk-udev-rules.nix +++ b/overlays/qmk-udev-rules.nix @@ -1,7 +1,7 @@ -self: super: let +_self: super: let lock = builtins.fromJSON (builtins.readFile ../flake.lock); in { - qmk-udev-rules = super.qmk-udev-rules.overrideAttrs (old: { + qmk-udev-rules = super.qmk-udev-rules.overrideAttrs (_old: { version = lock.nodes.qmk-udev-rules.locked.rev; src = super.fetchFromGitHub { inherit (lock.nodes.qmk-udev-rules.locked) owner repo rev; diff --git a/overlays/waybar-hypr.nix b/overlays/waybar-hypr.nix index d7b74bd..b56d9ea 100644 --- a/overlays/waybar-hypr.nix +++ b/overlays/waybar-hypr.nix @@ -1,4 +1,4 @@ -self: super: { +_self: super: { waybar-hypr = super.waybar.overrideAttrs (old: { pname = "waybar-hypr"; patchPhase = '' diff --git a/pkgs/rip.nix b/pkgs/rip.nix index ab9dcc3..c7c0807 100644 --- a/pkgs/rip.nix +++ b/pkgs/rip.nix @@ -1,13 +1,12 @@ { lib, - stdenv, rustPlatform, fetchFromGitHub, pkg-config, }: let lock = builtins.fromJSON (builtins.readFile ../flake.lock); in - rustPlatform.buildRustPackage rec { + rustPlatform.buildRustPackage { pname = "rip"; version = ""; @@ -24,6 +23,6 @@ in description = "A safe and ergonomic alternative to rm"; homepage = "https://github.com/nivekuil/rip"; license = with licenses; [gpl3]; - maintainers = with maintainers; []; + maintainers = []; }; } diff --git a/raw/README.md b/raw/README.md index c4f58df..eeae5f6 100644 --- a/raw/README.md +++ b/raw/README.md @@ -1,5 +1,6 @@ # Node Exporter + Please checkout the original repository! -Source: https://github.com/rfrail3/grafana-dashboards/tree/master/prometheus +Source: [github:rfrail3/grafana-dashboards](https://github.com/rfrail3/grafana-dashboards/tree/master/prometheus) License: Apache diff --git a/users/malte/broot.nix b/users/malte/broot.nix index ba4fdf4..730a393 100644 --- a/users/malte/broot.nix +++ b/users/malte/broot.nix @@ -1,4 +1,4 @@ -{pkgs, ...}: { +_: { programs.broot = { enable = true; enableFishIntegration = true; diff --git a/users/malte/cataclysm-dda.nix b/users/malte/cataclysm-dda.nix index 11de048..57d407d 100644 --- a/users/malte/cataclysm-dda.nix +++ b/users/malte/cataclysm-dda.nix @@ -18,14 +18,15 @@ # === Font === # FIXME: until https://github.com/NixOS/nixpkgs/issues/185633 is fixed - iosevka = + inherit (import (pkgs.fetchFromGitHub { owner = "NixOS"; repo = "nixpkgs"; rev = "0d440c18119406feb8a32cd5ec2ff0b83fc9104b"; sha256 = "sha256-Fw6zRNBonu9wwVSQ0Cj9zHliw6yChMQPf3GPQFJZ4us="; }) {system = "x86_64-linux";}) - .iosevka; + iosevka + ; fontSingleton = lib.singleton "${iosevka}/share/fonts/truetype/iosevka-bold.ttf"; fontsConfigPath = "${configDir}/fonts.json"; fontsConfig = jsonConfig.generate "fonts.json" { diff --git a/users/malte/git.nix b/users/malte/git.nix index 6197f2a..d2ac380 100644 --- a/users/malte/git.nix +++ b/users/malte/git.nix @@ -1,8 +1,4 @@ -{ - pkgs, - lib, - ... -}: let +{pkgs, ...}: let conf = import ./conf.nix; configDir = "~/.config/git"; deltaConfig = "${configDir}/delta"; diff --git a/users/malte/kanshi.nix b/users/malte/kanshi.nix index 22c80c7..27a4440 100644 --- a/users/malte/kanshi.nix +++ b/users/malte/kanshi.nix @@ -1,8 +1,4 @@ -{ - pkgs, - lib, - ... -}: let +{pkgs, ...}: let notify = profile: [ "${pkgs.libnotify}/bin/notify-send -t 10000 -a 'Kanshi' '${profile}' 'Profile activated'" ]; diff --git a/users/malte/kitty.nix b/users/malte/kitty.nix index 47d6fcb..1b0802e 100644 --- a/users/malte/kitty.nix +++ b/users/malte/kitty.nix @@ -1,9 +1,4 @@ -{ - pkgs, - lib, - config, - ... -}: let +{pkgs, ...}: let darkTheme = pkgs.writeTextFile { name = "kitty-dark"; text = builtins.readFile ./gruvbox_dark.conf; diff --git a/users/malte/qt.nix b/users/malte/qt.nix index 43893ed..9613ad1 100644 --- a/users/malte/qt.nix +++ b/users/malte/qt.nix @@ -1,4 +1,4 @@ -{pkgs, ...}: { +_: { qt = { enable = true; platformTheme = "gtk"; diff --git a/users/malte/shell.nix b/users/malte/shell.nix index 8073572..f719593 100644 --- a/users/malte/shell.nix +++ b/users/malte/shell.nix @@ -1,8 +1,4 @@ -{ - pkgs, - lib, - ... -}: { +{pkgs, ...}: { home.packages = with pkgs; [ (pkgs.callPackage ../../pkgs/rip.nix {}) bottom diff --git a/users/malte/zathura.nix b/users/malte/zathura.nix index 04cbd8e..ab19b12 100644 --- a/users/malte/zathura.nix +++ b/users/malte/zathura.nix @@ -1,6 +1,5 @@ { pkgs, - lib, config, ... }: let diff --git a/users/modules/colors.nix b/users/modules/colors.nix index 07a73e9..86cab5a 100644 --- a/users/modules/colors.nix +++ b/users/modules/colors.nix @@ -1,8 +1,6 @@ { pkgs, lib, - config, - nix-colors, ... }: let # Create a color from a hexadezimal 6 digit description, like 'FF0000' for pure red diff --git a/users/modules/darkman.nix b/users/modules/darkman.nix index 2f5dfb5..7a593e7 100644 --- a/users/modules/darkman.nix +++ b/users/modules/darkman.nix @@ -6,7 +6,7 @@ }: let cfg = config.services.darkman; - hasInitScript = name: conf: (builtins.hasAttr "initialize" conf) && (conf.initialize != null); + hasInitScript = _name: conf: (builtins.hasAttr "initialize" conf) && (conf.initialize != null); mkActivationEntry = name: conf: { name = "darkman-initialize-${name}"; value = lib.hm.dag.entryAfter ["writeBoundary"] '' diff --git a/users/modules/restic-backup.nix b/users/modules/restic-backup.nix index a981bce..e8c6c6a 100644 --- a/users/modules/restic-backup.nix +++ b/users/modules/restic-backup.nix @@ -71,7 +71,7 @@ in { CacheDirectory = "restic-backups-to-faunus-ater"; CacheDirectoryMode = "0700"; # Convert the above map of environment variables into a list - # of "KEY=VALUE" entrie + # of "KEY=VALUE" entries Environment = builtins.attrValues (builtins.mapAttrs (k: v: "${k}=${v}") sessionVars);