nixos-config/flake.nix

129 lines
3.6 KiB
Nix

{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-droid.url = "github:NixOS/nixpkgs/nixos-23.05";
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
# simple mailserver
snm = {
url = "gitlab:simple-nixos-mailserver/nixos-mailserver/master";
# inputs.nixpkgs-23_05.follows = "nixpkgs";
};
nix-on-droid = {
url = "github:t184256/nix-on-droid/release-23.05";
inputs.nixpkgs.follows = "nixpkgs-droid";
};
emacs = {
url = "github:nix-community/emacs-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
# simplex-chat = {
# url = "github:simplex-chat/simplex-chat";
# inputs.nixpkgs.follows = "nixpkgs";
# };
# age for nix to store encrypted passwords conveniently
agenix = {
url = "github:ryantm/agenix";
inputs.nixpkgs.follows = "nixpkgs";
};
disko.url = "github:nix-community/disko";
disko.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, home-manager, nixpkgs, pre-commit-hooks, ... }@inputs: {
checks."x86_64-linux" = let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
in {
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.;
settings = { ormolu.defaultExtensions = [ "GHC2021" ]; };
tools.fourmolu = pkgs.haskellPackages.fourmolu;
hooks = {
nixfmt.enable = true;
fourmolu.enable = true;
hpack.enable = true;
hlint.enable = true;
};
};
};
nixosConfigurations."thrall" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [
({ inputs, lib, ... }: {
nixpkgs = {
config.allowUnfree = true;
overlays = with inputs; [ emacs.overlay ];
};
})
./hosts/thrall
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
}
{ home-manager.users.alex = ./hosts/thrall/alex.nix; }
];
};
nixosConfigurations."dregil" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [ ./hosts/dregil ];
};
nixosConfigurations."igor" = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { inherit inputs; };
modules = [ ./hosts/igor ];
};
nixOnDroidConfigurations.default = with inputs;
nix-on-droid.lib.nixOnDroidConfiguration {
modules = [
./hosts/redmi
{ nix.registry.nixpkgs.flake = nixpkgs-droid; }
{ nix.nixPath = [ "nixpkgs=${nixpkgs-droid}" ]; }
];
};
devShells."x86_64-linux".default = let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
in pkgs.haskellPackages.shellFor {
inherit (self.checks.${system}.pre-commit-check) shellHook;
packages = p: [ p.xmonad p.xmonad-contrib ];
withHoogle = true;
nativeBuildInputs = with pkgs; [
haskellPackages.haskell-language-server
haskellPackages.fourmolu
haskellPackages.hspec-discover
haskellPackages.doctest
haskellPackages.xmonad
haskellPackages.xmonad-contrib
cabal-install
ghcid
nixfmt
hpack
hlint
];
};
};
}