system/flake.nix

78 lines
1.9 KiB
Nix

{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
hardware.url = "github:NixOS/nixos-hardware/master";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
wired = {
url = "github:Toqozz/wired-notify";
inputs.nixpkgs.follows = "nixpkgs";
};
dedsec-grub-theme = {
url = "gitlab:VandalByte/dedsec-grub-theme";
inputs.nixpkgs.follows = "nixpkgs";
};
# nix lsp
nil = {
url = "github:oxalica/nil";
inputs.nixpkgs.follows = "nixpkgs";
};
# my neovim configuration
myneovim = {
url = "git+https://git.pleshevski.ru/mynix/neovim?rev=b22dfff883978841719da99d2abbfe7afaa91e4b";
inputs.nixpkgs.follows = "nixpkgs";
};
# tool to change .env faster
vnetod = {
url = "git+https://git.pleshevski.ru/pleshevskiy/vnetod";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs @ { self, nixpkgs, hardware, ... }:
let
system = "x86_64-linux";
in
{
nixosConfigurations =
nixpkgs.lib.mapAttrs
(hostname: { system
, specialArgs ? { }
, extraModules ? [ ]
, nixpkgs ? inputs.nixpkgs
}:
nixpkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs; } // specialArgs;
modules =
(with inputs; [ home-manager.nixosModule ])
++ [ ./machines/${hostname} ]
++ extraModules;
})
(import ./machines inputs);
devShells.${system} =
let
pkgs = import nixpkgs { inherit system; };
in
{
default = pkgs.mkShell {
packages = with pkgs; [
stylua # lua formatter
ormolu # haskell formatter
];
};
};
};
}