nixos-config/flake.nix

241 lines
7.3 KiB
Nix
Raw Normal View History

2024-11-22 00:58:04 -05:00
{
2024-11-22 20:46:58 -05:00
description = "cy's flake";
2024-11-22 00:58:04 -05:00
inputs = {
2025-01-13 20:09:39 -05:00
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable-small";
2024-11-23 21:41:28 -05:00
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
2025-01-01 21:46:36 -05:00
treefmt = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-12-28 22:16:46 -05:00
disko = {
url = "github:nix-community/disko/latest";
inputs.nixpkgs.follows = "nixpkgs";
};
2025-01-01 02:07:32 -05:00
lanzaboote = {
2025-01-19 20:53:31 -05:00
url = "github:nix-community/lanzaboote/master";
2025-01-01 02:07:32 -05:00
inputs.nixpkgs.follows = "nixpkgs";
2025-01-22 04:24:43 -05:00
inputs.crane.follows = "crane";
inputs.flake-compat.follows = "flake-compat";
inputs.flake-parts.follows = "flake-parts";
inputs.rust-overlay.follows = "rust-overlay";
2025-01-01 02:07:32 -05:00
};
2025-01-10 23:16:31 -05:00
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
2025-01-22 04:24:43 -05:00
inputs.flake-parts.follows = "flake-parts";
inputs.flake-compat.follows = "flake-compat";
inputs.home-manager.follows = "home-manager";
inputs.treefmt-nix.follows = "treefmt";
};
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
2025-01-10 23:16:31 -05:00
};
niri = {
url = "github:sodiboo/niri-flake";
inputs.nixpkgs.follows = "nixpkgs";
2025-01-22 04:24:43 -05:00
inputs.nixpkgs-stable.follows = "nixpkgs";
};
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
2025-01-22 02:07:37 -05:00
conduwuit = {
url = "github:girlbossceo/conduwuit";
2025-01-22 04:24:43 -05:00
inputs = {
nixpkgs.follows = "nixpkgs";
crane.follows = "crane";
flake-compat.follows = "flake-compat";
flake-utils.follows = "flake-utils";
};
2025-01-22 02:07:37 -05:00
};
lix-module = {
url = "git+https://git.lix.systems/lix-project/nixos-module";
inputs.nixpkgs.follows = "nixpkgs";
2025-01-22 04:24:43 -05:00
inputs.flake-utils.follows = "flake-utils";
2025-01-22 14:51:00 -05:00
inputs.lix.follows = "lix";
};
lix = {
url = "git+https://git.lix.systems/lix-project/lix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-compat.follows = "flake-compat";
2025-01-22 02:07:37 -05:00
};
2024-12-28 22:16:46 -05:00
nixpkgs-garage.url = "github:cything/nixpkgs/garage-module"; # unmerged PR
2025-01-21 21:56:26 -05:00
nvim-github-theme = {
url = "github:projekt0n/github-nvim-theme";
flake = false;
};
2025-01-22 04:24:43 -05:00
# deduplication
flake-utils.url = "github:numtide/flake-utils";
crane.url = "github:ipetkov/crane";
flake-compat.url = "github:edolstra/flake-compat";
2024-11-22 00:58:04 -05:00
};
2025-01-05 06:11:02 -05:00
nixConfig = {
extra-substituters = [
2025-01-05 07:03:26 -05:00
"https://cache.cything.io/central"
2025-01-18 20:39:51 -05:00
"https://niri.cachix.org"
"https://nix-community.cachix.org"
2025-01-21 04:22:58 -05:00
"https://cache.garnix.io"
"https://cything.cachix.org"
"https://aseipp-nix-cache.global.ssl.fastly.net"
2025-01-05 06:11:02 -05:00
];
2025-01-05 13:55:25 -05:00
extra-trusted-public-keys = [
2025-01-06 00:45:49 -05:00
"central:uWhjva6m6dhC2hqNisjn2hXGvdGBs19vPkA1dPEuwFg="
2025-01-18 20:39:51 -05:00
"niri.cachix.org-1:Wv0OmO7PsuocRKzfDoJ3mulSl7Z6oezYhGhR+3W2964="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
2025-01-21 04:22:58 -05:00
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
"cything.cachix.org-1:xqW1W5NNL+wrM9wfSELb0MLj/harD2ZyB4HbdaMyvPI="
2025-01-05 13:55:25 -05:00
];
2025-01-05 06:11:02 -05:00
builders-use-substitutes = true;
};
2024-12-19 02:32:58 -05:00
outputs =
{
self,
nixpkgs,
home-manager,
2024-12-28 22:16:46 -05:00
disko,
flake-parts,
2024-12-19 02:32:58 -05:00
...
}@inputs:
flake-parts.lib.mkFlake { inherit inputs; } (
{ ... }:
{
imports = [
2025-01-16 16:56:31 -05:00
inputs.treefmt.flakeModule
];
debug = true;
systems = [
"x86_64-linux"
];
perSystem =
{
2025-01-22 02:07:37 -05:00
inputs',
...
}:
{
2025-01-16 16:56:31 -05:00
treefmt = {
projectRootFile = "flake.nix";
programs.nixfmt.enable = true;
programs.stylua.enable = true;
programs.yamlfmt.enable = true;
programs.typos.enable = true;
programs.shellcheck.enable = true;
2025-01-19 21:45:11 -05:00
settings.global.excludes = [
"secrets/*"
"**/*.png" # tries to format a png file??
];
2025-01-16 16:56:31 -05:00
};
2024-12-19 02:32:58 -05:00
};
2024-12-13 21:57:30 -05:00
2025-01-16 18:48:33 -05:00
flake =
let
pkgs = import nixpkgs {
config.allowUnfree = true;
system = "x86_64-linux";
overlays = [
inputs.niri.overlays.niri
inputs.rust-overlay.overlays.default
] ++ import ./overlay;
2025-01-16 18:48:33 -05:00
};
in
{
2025-01-18 21:11:26 -05:00
nixosConfigurations =
let
lib = nixpkgs.lib;
in
{
ytnix = lib.nixosSystem {
specialArgs = { inherit inputs; };
modules = [
{
nixpkgs = { inherit pkgs; };
}
./hosts/ytnix
inputs.sops-nix.nixosModules.sops
./modules
inputs.lanzaboote.nixosModules.lanzaboote
inputs.niri.nixosModules.niri
inputs.lix-module.nixosModules.default # broken
2025-01-18 21:11:26 -05:00
];
};
chunk = lib.nixosSystem {
specialArgs = { inherit inputs; };
modules = [
{
nixpkgs = { inherit pkgs; };
disabledModules = [
"services/web-servers/garage.nix"
];
}
./hosts/chunk
inputs.sops-nix.nixosModules.sops
./modules
(inputs.nixpkgs-garage + "/nixos/modules/services/web-servers/garage.nix")
];
};
2024-12-12 23:35:10 -05:00
2025-01-18 21:11:26 -05:00
titan = lib.nixosSystem {
specialArgs = { inherit inputs; };
modules = [
{
nixpkgs = { inherit pkgs; };
}
./hosts/titan
disko.nixosModules.disko
inputs.sops-nix.nixosModules.sops
./modules
];
};
};
2025-01-18 21:11:26 -05:00
homeConfigurations =
let
lib = home-manager.lib;
in
{
"yt@ytnix" = lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = { inherit inputs; };
modules = [
./home/yt/ytnix.nix
inputs.nixvim.homeManagerModules.nixvim
inputs.niri.homeModules.config
];
};
2024-12-13 22:13:25 -05:00
2025-01-18 21:11:26 -05:00
"yt@chunk" = lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = { inherit inputs; };
modules = [
./home/yt/chunk.nix
inputs.nixvim.homeManagerModules.nixvim
];
};
2025-01-14 10:50:19 -05:00
2025-01-18 21:11:26 -05:00
"codespace@codespace" = lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = { inherit inputs; };
modules = [
./home/yt/codespace.nix
inputs.nixvim.homeManagerModules.nixvim
];
};
};
2025-01-18 21:11:26 -05:00
};
}
);
2024-11-22 00:58:04 -05:00
}