1
0
Fork 0
nix-homemanager-laptop/flake.nix

132 lines
4.6 KiB
Nix

{
description = "Home Manager configuration";
inputs = {
catppuccin.url = "github:catppuccin/nix";
devshell.url = "github:numtide/devshell";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
git-hooks-nix.url = "github:cachix/git-hooks.nix";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
lix-module = {
url = "https://git.lix.systems/lix-project/nixos-module/archive/main.tar.gz";
inputs.nixpkgs.follows = "nixpkgs";
};
nixgl = {
url = "github:nix-community/nixGL";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nur.url = "github:nix-community/NUR";
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
stylix = {
url = "github:danth/stylix";
inputs.nixpkgs.follows = "nixpkgs";
};
treefmt-nix.url = "github:numtide/treefmt-nix";
};
outputs =
inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } (
{ withSystem, ... }:
{
systems = [ "aarch64-linux" ];
imports = [
inputs.home-manager.flakeModules.home-manager
./modules
./languages
];
flake = {
# https://nix-community.github.io/home-manager/options.xhtml
homeConfigurations = {
asahi = withSystem "aarch64-linux" (
{ pkgs, ... }:
inputs.home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = { inherit inputs pkgs; };
modules = [
{ nixpkgs.overlays = [ inputs.nur.overlays.default ]; }
inputs.lix-module.nixosModules.default
inputs.sops-nix.homeManagerModules.sops
inputs.stylix.homeModules.stylix
inputs.catppuccin.homeModules.catppuccin
./home/home.nix
];
}
);
};
};
perSystem =
{ system, ... }:
let
pkgs = import inputs.nixpkgs {
inherit system;
overlays = [
inputs.nur.overlays.default
inputs.nixgl.overlays.default
];
};
in
{
_module.args.pkgs = pkgs;
# https://flake.parts/options/devshell.html
devshells.default = {
commands = [
{
help = " `home-manager switch` for asahi";
name = "hm-asahi";
command = "${pkgs.home-manager}/bin/home-manager switch --flake .#asahi";
category = " home-manager (Asahi)";
}
{
help = "󰸨 `home-manager switch` for asahi with backup";
name = "hm-asahi-backup";
command = "${pkgs.home-manager}/bin/home-manager switch --flake .#asahi -b backup";
category = " home-manager (Asahi)";
}
{
help = "󰘥 show home-manager documentation";
name = "man-home";
command = "${pkgs.man}/bin/man home-configuration.nix";
category = " home-manager";
}
{
help = " generate age key";
name = "age-generate-key";
command = "${pkgs.uutils-coreutils-noprefix}/bin/mkdir -p ~/.config/sops/age && ${pkgs.age}/bin/age-keygen -o ~/.config/sops/age/keys.txt && ${pkgs.uutils-coreutils-noprefix}/bin/cat ~/.config/sops/age/keys.txt";
category = " SOPS";
}
{
help = " edit secrets.yaml";
name = "sops-edit";
command = "${pkgs.sops}/bin/sops edit ./home/secrets/secrets.yaml";
category = " SOPS";
}
];
packages = [
pkgs.age
pkgs.forgejo-cli
pkgs.home-manager
pkgs.sops
];
devshell = {
motd = ''
{202} Nix Laptop Configuration{reset}
$(type -p menu &>/dev/null && menu)
'';
name = "Laptop Configuration";
};
};
pre-commit.settings.excludes = [ "home/vencord.nix" ];
treefmt.settings.global.excludes = [ "home/vencord.nix" ];
};
}
);
}