dotfiles/flake.nix

188 lines
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 = {
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
2022-07-15 13:11:54 +02:00
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
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.url = "github:ryantm/agenix";
agenix.inputs.nixpkgs.follows = "nixpkgs";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
home-manager.inputs.utils.follows = "flake-utils";
2022-05-26 13:50:03 +02:00
asus-touchpad-numpad-driver.url = "github:MoritzBoehme/asus-touchpad-numpad-driver/german-layout";
asus-touchpad-numpad-driver.flake = false;
2022-04-18 12:33:07 +02:00
arkenfox-userjs.url = "github:arkenfox/user.js";
arkenfox-userjs.flake = false;
2022-04-23 17:31:50 +02:00
howdy.url = "sourcehut:~moritzboehme/howdy";
howdy.inputs.nixpkgs.follows = "nixpkgs";
2022-11-25 10:24:29 +01:00
2023-01-28 11:04:33 +01:00
emacs.url = "git+ssh://git@gitea.moritzboeh.me/moritz/emacs.git?ref=main";
2022-12-23 12:39:24 +01:00
2023-04-05 08:54:30 +02:00
neovim.url = "github:neovim/neovim/83bfd94d1df5eecb8e4069a227c7d24598636d63?dir=contrib"; # HACK to fix neovim not building at the moment
2023-02-17 12:31:31 +01:00
nil.url = "github:oxalica/nil";
nil.inputs.nixpkgs.follows = "nixpkgs";
nil.inputs.flake-utils.follows = "flake-utils";
2023-02-17 13:01:11 +01:00
2023-01-01 15:27:31 +01:00
hyprland.url = "github:hyprwm/Hyprland";
2022-12-23 12:39:24 +01:00
hyprpaper.url = "github:hyprwm/hyprpaper";
2023-01-01 15:27:31 +01:00
hypr-contrib.url = "github:hyprwm/contrib";
2023-02-17 22:19:47 +01:00
nvim-treesitter-textsubjects.url = "github:RRethy/nvim-treesitter-textsubjects";
nvim-treesitter-textsubjects.flake = false;
smartcolumn-nvim.url = "github:m4xshen/smartcolumn.nvim";
smartcolumn-nvim.flake = false;
copilot-lua.url = "github:zbirenbaum/copilot.lua";
copilot-lua.flake = false;
lspsaga-nvim.url = "github:glepnir/lspsaga.nvim";
lspsaga-nvim.flake = false;
advanced-git-search-nvim.url = "github:aaronhallaert/advanced-git-search.nvim";
advanced-git-search-nvim.flake = false;
2023-04-05 08:51:06 +02:00
comment-box-nvim.url = "github:LudoPinelli/comment-box.nvim";
comment-box-nvim.flake = false;
attic.url = "github:zhaofengli/attic";
attic.inputs.nixpkgs.follows = "nixpkgs";
attic.inputs.nixpkgs-stable.follows = "stable";
attic.inputs.flake-utils.follows = "flake-utils";
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: super: { 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
2021-09-11 13:15:08 +02:00
channels.nixpkgs.overlaysBuilder = channels: [
2023-01-30 10:39:29 +01:00
inputs.emacs.overlays.default
2022-10-09 20:49:35 +02:00
inputs.howdy.overlays.default
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.hyprland.nixosModules.default
inputs.agenix.nixosModules.age
inputs.howdy.nixosModules.default
];
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
};
}