-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
65 lines (63 loc) · 1.82 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{
description = "KHSaad's NixOS configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
nur.url = "github:nix-community/NUR";
home-manager = {
url = "github:nix-community/home-manager/master";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
pollymc = {
url = "github:fn2006/PollyMC";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-parts.follows = "flake-parts";
};
};
outputs =
{ flake-parts, ... }@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
./hosts
./homes
];
systems = [ "x86_64-linux" ];
perSystem =
{ pkgs, ... }:
{
devShells.default = pkgs.mkShell {
packages = [
pkgs.stylua
pkgs.home-manager
];
};
# Took this from https://github.com/gerg-l/nixos :)
formatter = pkgs.writeShellApplication {
name = "lint";
runtimeInputs = [
pkgs.nixfmt-rfc-style
pkgs.deadnix
pkgs.statix
pkgs.stylua
pkgs.fd
];
text = ''
if [ -z "''${1:-""}" ] || [ "$1" == "." ]; then
fd '.*\.nix' . -x statix fix -- {} \;
fd '.*\.nix' . -X deadnix -e -- {} \; -X nixfmt {} \;
fd '.*\.lua' . -X stylua --indent-type Spaces --indent-width 2 {} \;
else
statix fix -- "$1"
deadnix -e "$1"
nixfmt "$1"
stylua --indent-type Spaces --indent-width 2 "$1"
fi
'';
};
};
};
}