Skip to content

Commit

Permalink
flake.nix: enable pre-commit-hooks
Browse files Browse the repository at this point in the history
clean up unused inputs
fmt
add .gitignore entries
  • Loading branch information
fufexan committed Sep 15, 2024
1 parent e2344b7 commit 9080f7c
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 51 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.terraform*
.direnv
.pre-commit-config.yaml
terraform.tfstate*
config.tf.json
100 changes: 70 additions & 30 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 10 additions & 7 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@
imports = [
./hosts
./modules
./pre-commit-hooks.nix
];

perSystem = {
config,
pkgs,
system,
inputs',
Expand All @@ -30,6 +32,9 @@
pkgs.sops
inputs'.agenix.packages.agenix
];
shellHook = ''
${config.pre-commit.installationScript}
'';
};
};
};
Expand All @@ -40,20 +45,18 @@
inputs.nixpkgs.follows = "nixpkgs";
};

disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};

flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};

impermanence.url = "github:nix-community/impermanence";

nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};

srvos = {
url = "github:numtide/srvos";
inputs.nixpkgs.follows = "nixpkgs";
Expand Down
32 changes: 18 additions & 14 deletions hosts/germanium/hardware-configuration.nix
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
# Do not modify this file! It was generated by ‘nixos-generate-config’
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:

{
imports =
[ (modulesPath + "/profiles/qemu-guest.nix")
];
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [
(modulesPath + "/profiles/qemu-guest.nix")
];

boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod"];
boot.initrd.kernelModules = [];
boot.kernelModules = [];
boot.extraModulePackages = [];

fileSystems."/" =
{ device = "/dev/disk/by-label/nixos";
fsType = "ext4";
};
fileSystems."/" = {
device = "/dev/disk/by-label/nixos";
fsType = "ext4";
};

swapDevices = [ ];
swapDevices = [];

# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
Expand Down
9 changes: 9 additions & 0 deletions pre-commit-hooks.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{inputs, ...}: {
imports = [inputs.pre-commit-hooks.flakeModule];

perSystem.pre-commit = {
settings.excludes = ["flake.lock"];

settings.hooks.alejandra.enable = true;
};
}

0 comments on commit 9080f7c

Please sign in to comment.