1
0
Fork 0
nixos-config/flake.nix

115 lines
3.5 KiB
Nix
Raw Normal View History

2023-01-15 23:30:25 +00:00
{
description = "maralorns configuration";
2023-01-19 03:13:41 +00:00
nixConfig = {
allow-import-from-derivation = true;
};
2023-01-15 23:30:25 +00:00
inputs = {
2023-02-02 04:55:06 +00:00
secrets = {
url = "git+ssh://git@hera.m-0.eu/config-secrets";
2023-02-02 03:58:37 +00:00
inputs.nixpkgs.follows = "nixos-unstable";
2023-01-31 21:37:18 +00:00
};
2023-02-04 00:43:09 +00:00
emanote = {
url = "github:srid/emanote";
inputs = {
flake-parts.follows = "flake-parts";
nixpkgs.follows = "nixos-unstable";
};
};
nix-output-monitor = {
inputs = {
flake-compat.follows = "pre-commit-hooks/flake-compat";
flake-utils.follows = "pre-commit-hooks/flake-utils";
nixpkgs.follows = "nixos-unstable";
pre-commit-hooks.follows = "pre-commit-hooks";
};
url = "git+ssh://git@hera.m-0.eu/nix-output-monitor?ref=main";
};
2023-02-03 05:37:18 +00:00
nixos-unstable.url = "nixpkgs/nixos-unstable";
2023-02-04 00:43:09 +00:00
nixos-mailserver = {
inputs = {
flake-compat.follows = "pre-commit-hooks/flake-compat";
utils.follows = "pre-commit-hooks/flake-utils";
nixpkgs.follows = "nixos-unstable";
nixpkgs-22_11.follows = "nixos-stable";
};
url = "git+https://gitlab.com/simple-nixos-mailserver/nixos-mailserver.git";
};
2023-02-03 05:37:18 +00:00
nixos-stable.url = "nixpkgs/nixos-22.11";
2023-02-02 03:58:37 +00:00
nixpkgs.follows = "nixos-unstable";
flake-parts.inputs.nixpkgs-lib.follows = "nixos-unstable";
2023-02-03 05:37:18 +00:00
home-manager = {
url = "home-manager/release-22.11";
inputs = {
2023-02-04 00:43:09 +00:00
utils.follows = "pre-commit-hooks/flake-utils";
2023-02-03 05:37:18 +00:00
nixpkgs.follows = "nixos-unstable";
};
};
2023-02-02 04:55:06 +00:00
hexa-nur-packages = {
url = "github:mweinelt/nur-packages";
inputs.nixpkgs.follows = "nixos-unstable";
};
2023-02-04 00:43:09 +00:00
pre-commit-hooks = {
2023-01-15 23:30:25 +00:00
url = "github:cachix/pre-commit-hooks.nix";
2023-02-01 02:10:48 +00:00
inputs = {
nixpkgs-stable.follows = "nixos-stable";
2023-02-02 03:58:37 +00:00
nixpkgs.follows = "nixos-unstable";
2023-02-01 02:10:48 +00:00
};
2023-01-15 23:30:25 +00:00
};
};
2023-02-03 05:37:18 +00:00
outputs = inputs @ {nixos-hardware, ...}:
2023-02-02 03:58:37 +00:00
inputs.flake-parts.lib.mkFlake {inherit inputs;} {
2023-01-15 23:30:25 +00:00
imports = [
2023-02-04 00:43:09 +00:00
inputs.pre-commit-hooks.flakeModule
2023-02-07 12:03:18 +00:00
./nixos/flake-parts.nix
./home-manager/flake-parts.nix
./packages/flake-parts.nix
2023-01-15 23:30:25 +00:00
];
systems = ["x86_64-linux"];
perSystem = {
self',
2023-01-31 21:37:18 +00:00
inputs',
2023-01-15 23:30:25 +00:00
pkgs,
config,
2023-01-19 03:13:41 +00:00
lib,
2023-01-15 23:30:25 +00:00
...
2023-02-03 05:37:18 +00:00
}: {
2023-02-02 04:55:06 +00:00
devShells = {
default = pkgs.mkShell {
shellHook = config.pre-commit.installationScript;
};
2023-01-15 23:30:25 +00:00
};
2023-02-02 03:58:37 +00:00
checks = {
system-checks = pkgs.runCommand "system-checks" {} ''
2023-02-03 05:37:18 +00:00
mkdir -p $out
${lib.concatMapStringsSep "\n" (x: x) (lib.mapAttrsToList (name: x: "ln -s ${x.config.system.build.toplevel} $out/${name}-system") inputs.self.nixosConfigurations)}
${lib.concatMapStringsSep "\n" (x: x) (lib.mapAttrsToList (name: x: "ln -s ${x} $out/${name}-home") inputs.self.homeModes)}
2023-02-02 03:58:37 +00:00
'';
};
2023-01-19 03:13:41 +00:00
2023-01-15 23:30:25 +00:00
pre-commit = {
check.enable = true;
2023-01-16 02:57:11 +00:00
settings = {
settings.ormolu.defaultExtensions = [
"TypeApplications"
"BangPatterns"
"ImportQualifiedPost"
"BlockArguments"
];
hooks = {
hlint.enable = true;
alejandra.enable = true;
nix-linter.enable = false; # Too many false positives for now
statix.enable = true;
fourmolu.enable = true;
shellcheck.enable = true;
2023-01-16 03:26:37 +00:00
cabal-fmt.enable = true;
dhall-format.enable = true;
2023-01-16 02:57:11 +00:00
};
2023-01-15 23:30:25 +00:00
};
};
};
};
}