aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorMiran Bastaja <miran.bastaja04@gmail.com>2024-07-04 22:58:28 +0200
committerMiran Bastaja <miran.bastaja04@gmail.com>2024-07-04 22:58:28 +0200
commit333f134ec64739abf0c3e46e59a4a8ad88b883b5 (patch)
tree5c41313437176f100116883b353c7efd4b9b7ab3 /flake.nix
parent430d063f50824b0b268e73c8577705dc2c4fc318 (diff)
formatting
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix109
1 files changed, 52 insertions, 57 deletions
diff --git a/flake.nix b/flake.nix
index e309883..c5bcc5e 100644
--- a/flake.nix
+++ b/flake.nix
@@ -41,8 +41,7 @@
};
};
- outputs =
- inputs@{ flake-parts, ... }:
+ outputs = inputs@{ flake-parts, ... }:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" ];
imports = [
@@ -51,70 +50,66 @@
inputs.pre-commit-hooks-nix.flakeModule
];
- flake.nixosConfigurations =
- let
- generateNixosConfig = name: _value: {
- system = "x86_64-linux"; # I don't have any other type of machine yet
- modules = [
- inputs.home-manager.nixosModules.home-manager
- inputs.sops-nix.nixosModules.sops
- inputs.disko.nixosModules.disko
- ./share/system/common.nix
+ flake.nixosConfigurations = let
+ generateNixosConfig = name: _value: {
+ system = "x86_64-linux"; # I don't have any other type of machine yet
+ modules = [
+ inputs.home-manager.nixosModules.home-manager
+ inputs.sops-nix.nixosModules.sops
+ inputs.disko.nixosModules.disko
+ ./share/system/common.nix
- # This directory has to exist and have a `default.nix` in it, see
- # `./hosts` directory for examples
- ./hosts/${name}
- ];
- specialArgs = {
- inherit inputs;
- flakeRoot = ./.;
- };
+ # This directory has to exist and have a `default.nix` in it, see
+ # `./hosts` directory for examples
+ ./hosts/${name}
+ ];
+ specialArgs = {
+ inherit inputs;
+ flakeRoot = ./.;
};
- # wrapper around nixpkgs.lib.nixosSystem to enable using it on attrsets
- generateNixosSystem = _name: value: inputs.nixpkgs.lib.nixosSystem value;
+ };
+ # wrapper around nixpkgs.lib.nixosSystem to enable using it on attrsets
+ generateNixosSystem = _name: value:
+ inputs.nixpkgs.lib.nixosSystem value;
- hosts = builtins.readDir ./hosts;
- nixosConfigs = builtins.mapAttrs generateNixosConfig hosts;
- # If you want to add something to a particular system, do it here before
- # the `in ...` line
+ hosts = builtins.readDir ./hosts;
+ nixosConfigs = builtins.mapAttrs generateNixosConfig hosts;
+ # If you want to add something to a particular system, do it here before
+ # the `in ...` line
- in
- builtins.mapAttrs generateNixosSystem nixosConfigs;
+ in builtins.mapAttrs generateNixosSystem nixosConfigs;
- perSystem =
- { pkgs, config, ... }:
- {
- devshells.default = {
- name = "nixconf-sh";
+ perSystem = { pkgs, config, ... }: {
+ devshells.default = {
+ name = "nixconf-sh";
- devshell.startup.pre-commit-install.text = config.pre-commit.installationScript;
+ devshell.startup.pre-commit-install.text =
+ config.pre-commit.installationScript;
- packages = (builtins.attrValues config.treefmt.build.programs);
- commands = with pkgs; [
- { package = git; }
- { package = gitui; }
- { package = sops; }
- { package = config.treefmt.build.wrapper; }
- ];
- };
+ packages = (builtins.attrValues config.treefmt.build.programs);
+ commands = with pkgs; [
+ { package = git; }
+ { package = gitui; }
+ { package = sops; }
+ { package = config.treefmt.build.wrapper; }
+ ];
+ };
- treefmt = {
- projectRootFile = ./flake.nix;
- programs = {
- nixpkgs-fmt.enable = true;
- };
- };
+ treefmt = {
+ projectRootFile = ./flake.nix;
+ programs = { nixfmt.enable = true; };
+ };
- pre-commit = {
- check.enable = false;
- settings = {
- hooks = {
- treefmt.enable = true;
- treefmt.package = config.treefmt.build.wrapper;
- deadnix.enable = true;
- };
+ pre-commit = {
+ check.enable = false;
+ settings = {
+ hooks = {
+ treefmt.enable = true;
+ treefmt.package = config.treefmt.build.wrapper;
+ deadnix.enable = true;
};
- }; # end of pre-commit
- }; # end of perSystem
+ };
+ }; # end of pre-commit
+ }; # end of perSystem
}; # end of inputs.flake-parts.lib.mkFlake
}