Files
nix-dotfiles/flake.nix
T

222 lines
6.3 KiB
Nix
Raw Normal View History

2023-12-23 06:49:01 +01:00
{
description = "NixOS configuration for my machines";
2023-12-23 06:49:01 +01:00
2024-02-01 16:50:14 -05:00
nixConfig = {
substituters = [
2024-02-18 06:11:47 +01:00
"https://cache.nixos.org/?priority=1&want-mass-query=true"
"https://nix-community.cachix.org/?priority=10&want-mass-query=true"
2025-05-26 23:08:23 -04:00
"https://attic.nayeonie.com/nix-cache"
2025-06-01 14:04:09 -04:00
"https://cosmic.cachix.org/"
];
trusted-substituters = [
"https://cache.nixos.org"
"https://nix-community.cachix.org"
2025-05-26 23:08:23 -04:00
"https://attic.nayeonie.com/nix-cache"
2025-06-01 14:04:09 -04:00
"https://cosmic.cachix.org/"
];
trusted-public-keys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
2025-05-26 23:08:23 -04:00
"nix-cache:grGRsHhqNDhkEuTODvHJXYmoCClntC+U8XAJQzwMaZM="
2025-06-01 14:04:09 -04:00
"cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE="
];
2024-04-01 18:26:03 -04:00
trusted-users = [ "root" ];
2025-03-26 15:54:39 -04:00
allow-import-from-derivation = true;
fallback = true;
2024-02-01 16:50:14 -05:00
};
2024-05-20 01:11:38 -04:00
inputs = {
2025-06-01 14:04:09 -04:00
# flake inputs with no explicit deps (in alphabetic order)
2024-05-21 19:55:10 -04:00
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
flake-parts.url = "github:hercules-ci/flake-parts";
2024-05-20 01:11:38 -04:00
nixos-hardware.url = "github:NixOS/nixos-hardware";
2025-10-20 21:47:39 -04:00
#nixpkgs.url = "github:nuschtos/nuschtpkgs/nixos-unstable";
2025-10-20 21:33:18 -04:00
#nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable-small";
2025-10-20 21:47:39 -04:00
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
2025-03-18 22:03:02 -04:00
#nixpkgs.url = "github:nixos/nixpkgs/1d2fe0135f360c970aee1d57a53f816f3c9bddae?narHash=sha256-Up7YlXIupmT7fEtC4Oj676M91INg0HAoamiswAsA3rc%3D";
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.11";
2024-05-20 01:11:38 -04:00
systems.url = "github:nix-systems/default";
2024-02-02 22:54:36 +01:00
2025-06-01 14:04:09 -04:00
# flake inputs with dependencies (in alphabetic order)
2026-05-03 14:09:35 -04:00
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-06-09 10:29:30 -04:00
firefox-addons = {
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
2024-06-19 15:29:55 -04:00
inputs = {
nixpkgs.follows = "nixpkgs";
};
2024-06-09 10:29:30 -04:00
};
2024-05-20 01:11:38 -04:00
flake-utils = {
url = "github:numtide/flake-utils";
inputs.systems.follows = "systems";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
2025-03-26 02:43:56 -04:00
hydra = {
2025-04-01 15:18:39 -04:00
url = "git+https://nayeonie.com/ahuston-0/hydra?ref=add-gitea-pulls";
2025-06-01 14:04:09 -04:00
inputs = {
2025-12-07 17:35:43 -05:00
#nixpkgs.follows = "nixpkgs";
2025-06-01 14:04:09 -04:00
};
2025-03-26 02:43:56 -04:00
};
2024-05-20 01:11:38 -04:00
hyprland-contrib = {
url = "github:hyprwm/contrib";
inputs.nixpkgs.follows = "nixpkgs";
};
2025-07-08 01:10:59 -04:00
#lix-module = {
# url = "git+https://git.lix.systems/lix-project/nixos-module?ref=stable";
# inputs = {
# nixpkgs.follows = "nixpkgs";
# flake-utils.follows = "flake-utils";
# };
#};
2025-07-04 01:45:07 -04:00
2024-05-20 01:11:38 -04:00
nix-index-database = {
url = "github:Mic92/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-08-09 11:07:46 -04:00
2025-06-01 14:04:09 -04:00
nixos-cosmic = {
url = "github:lilyinstarlight/nixos-cosmic";
inputs = {
flake-compat.follows = "flake-compat";
nixpkgs.follows = "nixpkgs";
nixpkgs-stable.follows = "nixpkgs-stable";
rust-overlay.follows = "rust-overlay";
};
};
2024-06-03 11:27:04 -04:00
nixos-generators = {
url = "github:nix-community/nixos-generators";
inputs.nixpkgs.follows = "nixpkgs";
};
2024-05-20 01:11:38 -04:00
nixos-modules = {
2025-10-20 21:33:18 -04:00
url = "github:NuschtOS/nixos-modules";
2024-05-20 01:11:38 -04:00
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
};
pre-commit-hooks = {
2024-08-06 17:27:44 -04:00
url = "github:cachix/git-hooks.nix";
2024-05-20 01:11:38 -04:00
inputs = {
nixpkgs.follows = "nixpkgs";
2024-05-21 19:55:10 -04:00
flake-compat.follows = "flake-compat";
2024-05-20 01:11:38 -04:00
};
};
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
2024-08-08 23:44:36 -04:00
stylix = {
url = "github:danth/stylix";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
2024-05-20 01:11:38 -04:00
wired-notify = {
url = "github:Toqozz/wired-notify";
inputs = {
nixpkgs.follows = "nixpkgs";
rust-overlay.follows = "rust-overlay";
2024-05-21 19:55:10 -04:00
flake-parts.follows = "flake-parts";
2024-05-20 01:11:38 -04:00
};
};
};
2024-03-03 18:06:28 -05:00
outputs =
{ self, nixpkgs, ... }@inputs:
2023-12-27 10:03:13 +01:00
let
systems = [
"x86_64-linux"
2024-05-20 00:11:17 -04:00
# disable arm for now as hydra isn't set up for it
2025-04-01 13:59:09 -04:00
# "aarch64-linuxa
];
2024-02-01 16:50:14 -05:00
forEachSystem = lib.genAttrs systems;
2024-02-02 06:12:49 +01:00
# gets the base path of the repo
src = builtins.path { path = ./.; };
2024-05-15 00:38:59 -04:00
# adds our lib functions to lib namespace
lib = nixpkgs.lib.extend (
self: _:
import ./lib {
inherit nixpkgs inputs;
lib = self;
2024-05-15 00:38:59 -04:00
}
);
2026-05-01 01:17:39 -04:00
packageSetup = import ./pkgs/default.nix { inherit nixpkgs; };
inherit (packageSetup) localPackagesOverlay;
2025-04-01 13:59:09 -04:00
inherit (lib.adev.systems) genSystems getImages;
inherit (self) outputs; # for hydra
in
2024-05-19 23:32:52 -04:00
rec {
2024-05-19 10:26:46 -04:00
inherit lib; # for allowing use of custom functions in nix repl
2026-05-01 01:17:39 -04:00
overlays.default = localPackagesOverlay;
2025-12-07 19:29:24 -05:00
hydraJobs = import ./hydra/jobs.nix { inherit inputs outputs systems; };
formatter = forEachSystem (system: nixpkgs.legacyPackages.${system}.nixfmt);
2024-05-15 00:38:59 -04:00
2024-10-23 00:00:00 -04:00
nixosConfigurations = genSystems inputs outputs src (src + "/systems");
homeConfigurations = {
"alice" = inputs.home-manager.lib.homeManagerConfiguration {
2026-05-01 01:17:39 -04:00
pkgs = packageSetup.mkPkgs "x86_64-linux";
modules = [
inputs.stylix.homeModules.stylix
inputs.sops-nix.homeManagerModules.sops
inputs.nix-index-database.homeModules.nix-index
{
nixpkgs.config = {
allowUnfree = true;
allowUnfreePredicate = _: true;
};
}
./users/alice/home.nix
];
extraSpecialArgs = {
inherit inputs outputs;
machineConfig = {
server = false;
};
};
};
};
2024-06-03 20:59:02 -04:00
images = {
install-iso = getImages nixosConfigurations "install-iso";
iso = getImages nixosConfigurations "iso";
qcow = getImages nixosConfigurations "qcow";
};
2026-05-01 01:17:39 -04:00
packages = forEachSystem packageSetup.mkPackages;
2026-05-01 01:07:42 -04:00
2024-05-19 23:32:52 -04:00
checks = import ./checks.nix { inherit inputs forEachSystem formatter; };
2024-05-19 23:38:11 -04:00
devShells = import ./shell.nix { inherit inputs forEachSystem checks; };
2024-08-22 09:35:39 -04:00
2023-12-23 06:49:01 +01:00
};
}