dots/flake.nix

130 lines
3.6 KiB
Nix
Raw Normal View History

2023-11-30 00:49:32 -06:00
{
description = "Price Hiller's home manager configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
2024-02-13 12:31:59 -06:00
flake-utils.url = "github:numtide/flake-utils";
kanagawa-gtk = {
url = "path:./pkgs/kanagawa-gtk";
inputs.nixpkgs.follows = "nixpkgs";
};
bob = {
url = "path:./pkgs/bob-nvim";
inputs.nixpkgs.follows = "nixpkgs";
};
Fmt = {
url = "path:pkgs/Fmt";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-11-30 00:49:32 -06:00
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-02-13 09:29:46 -06:00
waybar = {
url = "github:Alexays/Waybar";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-11-30 00:49:32 -06:00
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
wezterm = {
url = "github:wez/wezterm?dir=nix";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-02-29 02:07:22 -06:00
nixgl.url = "github:guibou/nixGL";
agenix = {
url = "github:yaxitech/ragenix";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-11-30 00:49:32 -06:00
};
2024-04-19 22:27:46 -05:00
outputs =
inputs@{
self,
home-manager,
nixpkgs,
...
}:
2023-11-30 00:49:32 -06:00
let
system = "x86_64-linux";
username = "sam";
pkgs = nixpkgs.legacyPackages.${system};
2024-04-19 22:27:46 -05:00
in
{
packages.x86_64-linux.default = home-manager.defaultPackage.x86_64-linux;
checks.${system} = {
2024-04-19 22:27:46 -05:00
formatting =
pkgs.runCommand "check-dot-file-formatting"
{
buildInputs = with pkgs; [
findutils
inputs.Fmt.packages.x86_64-linux.default
2024-02-04 22:26:55 -06:00
];
2024-04-19 22:27:46 -05:00
}
''
set -euo pipefail
cd ${self}
Fmt -- $(find . -type f)
printf "TEST COMPLETED!\n" > $out
'';
};
homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {
inherit inputs;
inherit self;
2024-02-04 22:26:55 -06:00
};
2024-04-19 22:27:46 -05:00
modules = [
({
imports = [ inputs.agenix.homeManagerModules.default ];
nixpkgs.overlays = [
inputs.neovim-nightly-overlay.overlay
inputs.bob.overlays.default
inputs.Fmt.overlays.default
inputs.kanagawa-gtk.overlays.default
inputs.nixgl.overlay
(final: prev: {
waybar = inputs.waybar.packages.${system}.default;
lxappearance = prev.lxappearance.overrideAttrs (oldAttrs: {
postInstall = ''
wrapProgram $out/bin/lxappearance --prefix GDK_BACKEND : x11
'';
});
opensnitch-ui = prev.opensnitch-ui.overrideAttrs (oldAttrs: {
propagatedBuildInputs = oldAttrs.propagatedBuildInputs ++ [ prev.python311Packages.qt-material ];
});
})
];
home = {
username = "${username}";
homeDirectory = "/home/${username}";
stateVersion = "24.05";
};
})
./config
];
};
}
// inputs.flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ inputs.agenix.overlays.default ];
};
2024-04-19 22:27:46 -05:00
in
{
devShells.default = pkgs.mkShell {
packages = with pkgs; [
age
age-plugin-yubikey
pkgs.agenix
nixos-rebuild
pkgs.deploy-rs
];
shellHook = ''
export RULES="$PWD/secrets/secrets.nix"
'';
};
2024-04-19 22:27:46 -05:00
}
);
2023-11-30 00:49:32 -06:00
}