dotfiles/flake.nix

183 lines
6.7 KiB
Nix
Raw Normal View History

2021-09-08 19:43:08 +02:00
{
description = "My awesome system config";
2021-09-15 00:41:46 +02:00
2023-04-05 08:51:06 +02:00
/*
Inputs
*/
2021-09-08 19:43:08 +02:00
inputs = {
# Nix
2022-03-21 13:23:54 +01:00
master.url = "github:nixos/nixpkgs";
2022-03-21 13:23:36 +01:00
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
2022-11-26 11:37:59 +01:00
stable.url = "github:nixos/nixpkgs/nixos-22.11";
2021-09-10 14:00:56 +02:00
2023-02-24 18:42:20 +01:00
flake-utils.url = "github:numtide/flake-utils";
utils.url = "github:gytis-ivaskevicius/flake-utils-plus";
utils.inputs.flake-utils.follows = "flake-utils";
agenix.inputs.nixpkgs.follows = "nixpkgs";
agenix.url = "github:ryantm/agenix";
attic.inputs.flake-utils.follows = "flake-utils";
attic.inputs.nixpkgs-stable.follows = "stable";
attic.inputs.nixpkgs.follows = "nixpkgs";
attic.url = "github:zhaofengli/attic";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
home-manager.inputs.utils.follows = "flake-utils";
home-manager.url = "github:nix-community/home-manager";
2022-05-26 13:50:03 +02:00
nil.inputs.flake-utils.follows = "flake-utils";
nil.inputs.nixpkgs.follows = "nixpkgs";
nil.url = "github:oxalica/nil";
2022-04-18 12:33:07 +02:00
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
2022-04-23 17:31:50 +02:00
# Neovim
neovim.url = "github:neovim/neovim/83bfd94d1df5eecb8e4069a227c7d24598636d63?dir=contrib"; # HACK to fix neovim not building at the moment
2022-11-25 10:24:29 +01:00
comment-box-nvim.flake = false;
comment-box-nvim.url = "github:LudoPinelli/comment-box.nvim";
2022-12-23 12:39:24 +01:00
copilot-lua.flake = false;
copilot-lua.url = "github:zbirenbaum/copilot.lua";
2023-02-17 12:31:31 +01:00
gitignore-nvim.flake = false;
gitignore-nvim.url = "github:wintermute-cell/gitignore.nvim";
2023-02-17 13:01:11 +01:00
lspsaga-nvim.flake = false;
lspsaga-nvim.url = "github:glepnir/lspsaga.nvim";
2023-02-17 22:19:47 +01:00
nvim-treesitter-textsubjects.flake = false;
nvim-treesitter-textsubjects.url = "github:RRethy/nvim-treesitter-textsubjects";
smartcolumn-nvim.flake = false;
smartcolumn-nvim.url = "github:m4xshen/smartcolumn.nvim";
# Hyprland
hypr-contrib.url = "github:hyprwm/contrib";
hyprland.url = "github:hyprwm/Hyprland";
hyprpaper.url = "github:hyprwm/hyprpaper";
2023-04-05 08:51:06 +02:00
# Laptop
asus-touchpad-numpad-driver.url = "github:MoritzBoehme/asus-touchpad-numpad-driver/german-layout";
asus-touchpad-numpad-driver.flake = false;
2023-04-10 14:36:40 +02:00
# Firefox user.js
arkenfox-userjs.url = "github:arkenfox/user.js";
arkenfox-userjs.flake = false;
2021-09-08 19:43:08 +02:00
};
2023-04-05 08:51:06 +02:00
/*
Outputs
*/
2022-07-15 13:11:54 +02:00
outputs =
2022-10-15 19:05:51 +02:00
inputs@{ self, nixpkgs, utils, ... }:
2021-09-08 20:30:19 +02:00
utils.lib.mkFlake {
2021-09-08 19:43:08 +02:00
inherit self inputs;
2022-12-30 18:58:13 +01:00
supportedSystems = [ "x86_64-linux" ];
2021-10-05 13:57:48 +02:00
channelsConfig.allowUnfree = true;
2021-10-05 13:58:06 +02:00
lib = nixpkgs.lib.extend
(self: _: { my = import ./lib { lib = self; }; });
2023-04-05 08:51:06 +02:00
/*
Overlays
*/
overlay = import ./overlays {
inherit inputs;
inherit (self) lib;
};
2022-12-30 18:58:13 +01:00
channels.nixpkgs.overlaysBuilder = _: [
2023-01-01 15:27:31 +01:00
inputs.hypr-contrib.overlays.default
2022-12-30 18:58:13 +01:00
inputs.hyprland.overlays.default
inputs.utils.overlay
2023-01-01 15:27:31 +01:00
self.overlay
2021-09-11 13:15:08 +02:00
];
2022-12-30 18:58:13 +01:00
# overlays = utils.lib.exportOverlays {
# inherit (self) pkgs inputs;
# };
overlays.default = self.overlay;
2023-04-05 08:51:06 +02:00
/*
Modules
*/
2022-07-15 13:11:54 +02:00
nixosModules = utils.lib.exportModules [
./modules/profiles/base.nix
./modules/profiles/gaming.nix
./modules/profiles/desktop.nix
];
hostDefaults.modules = [
./modules/default.nix
self.nixosModules.base
inputs.home-manager.nixosModule
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = { inherit inputs self; };
};
}
inputs.agenix.nixosModules.age
];
2021-09-08 19:43:08 +02:00
2022-07-15 13:11:54 +02:00
hosts.nixos-laptop.modules = [
./hosts/nixos-laptop
self.nixosModules.desktop
self.nixosModules.gaming
2022-07-15 13:11:54 +02:00
];
2022-10-15 19:05:51 +02:00
2022-12-23 12:39:24 +01:00
2022-07-15 13:11:54 +02:00
hosts.nixos-desktop.modules = [
./hosts/nixos-desktop
self.nixosModules.desktop
self.nixosModules.gaming
];
2021-10-05 13:58:06 +02:00
2023-04-05 08:51:06 +02:00
/*
Other Outputs
*/
2021-10-05 13:57:48 +02:00
outputsBuilder = channels:
with channels.nixpkgs; {
2022-07-15 13:11:54 +02:00
devShells.default = mkShell {
inherit (self.checks.${system}.pre-commit-check) shellHook;
2021-10-05 13:57:48 +02:00
name = "dotfiles";
2021-11-22 11:13:18 +01:00
packages = [
# Secrets
2022-05-26 13:46:59 +02:00
pkgs.agenix
2022-07-15 13:11:54 +02:00
# cachix
2021-11-22 11:13:18 +01:00
cachix
];
2021-10-05 13:57:48 +02:00
};
2022-10-15 19:05:51 +02:00
2022-07-15 13:11:54 +02:00
checks.pre-commit-check = inputs.pre-commit-hooks.lib."${system}".run {
src = ./.;
hooks = {
nixpkgs-fmt.enable = true;
statix.enable = true;
shellcheck.enable = true;
2023-02-16 18:03:55 +01:00
stylua.enable = true;
2022-07-15 13:11:54 +02:00
};
};
2022-12-30 18:58:13 +01:00
packages = utils.lib.exportPackages self.overlays channels;
2021-10-05 13:57:48 +02:00
};
2021-09-08 19:43:08 +02:00
};
}