nixos/flake.nix

95 lines
2.4 KiB
Nix
Raw Normal View History

2023-07-05 22:32:26 +04:00
# load stuff
{
description = "horrible dotfiles for amazing distro";
inputs = {
2023-12-25 01:35:40 +04:00
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; # nixpkgs stable branch
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; # nixpkgs unstable branch
2023-08-19 14:17:35 +04:00
home-manager = {
2023-12-25 01:35:40 +04:00
# this manages your dotfiles for the most part
url = "github:nix-community/home-manager/release-23.11";
2023-08-19 14:17:35 +04:00
inputs.nixpkgs.follows = "nixpkgs";
};
NixOS-WSL = {
2023-12-25 01:35:40 +04:00
# this makes nixos on wsl a thing
2023-08-19 11:20:34 +04:00
url = "github:nix-community/NixOS-WSL";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-10-05 13:55:36 +04:00
sops-nix = {
2023-12-25 01:35:40 +04:00
# this manages secrets
2023-10-05 13:55:36 +04:00
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-12-26 15:02:02 +04:00
emacs-overlay = {
url = "github:nix-community/emacs-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-07-05 22:32:26 +04:00
};
2023-08-07 17:28:33 +04:00
outputs = {
self,
nixpkgs,
home-manager,
NixOS-WSL,
2023-08-23 18:34:42 +04:00
sops-nix,
2023-12-26 15:02:02 +04:00
emacs-overlay,
2023-08-07 17:28:33 +04:00
...
} @ inputs: let
2023-07-07 03:06:45 +04:00
inherit (self) outputs;
2023-08-07 17:28:33 +04:00
forAllSystems = nixpkgs.lib.genAttrs [
"x86_64-linux"
];
in rec {
2023-07-07 03:06:45 +04:00
# custom packages
2023-08-07 17:28:33 +04:00
packages = forAllSystems (
system: let
pkgs = nixpkgs.legacyPackages.${system};
in
import ./packages {inherit pkgs;}
2023-07-07 03:06:45 +04:00
);
# dev shell for bootstrap
2023-08-07 17:28:33 +04:00
devShells = forAllSystems (
system: let
pkgs = nixpkgs.legacyPackages.${system};
in
import ./shell.nix {inherit pkgs;}
2023-07-27 21:59:50 +04:00
);
2023-08-07 17:28:33 +04:00
2023-07-07 03:06:45 +04:00
# overlays here
2023-08-07 17:28:33 +04:00
overlays = import ./overlays {inherit inputs;};
2023-07-07 03:06:45 +04:00
# modules :D
nixosModules = import ./modules;
2023-07-05 22:32:26 +04:00
nixosConfigurations = {
2023-07-06 02:02:21 +04:00
sakotop = nixpkgs.lib.nixosSystem {
2023-08-07 17:28:33 +04:00
specialArgs = {inherit inputs outputs;};
2023-07-07 03:06:45 +04:00
modules = [
2023-08-07 17:28:33 +04:00
./default.nix
2023-07-07 03:06:45 +04:00
./hosts/sakotop/configuration.nix
sops-nix.nixosModules.sops
2023-07-07 03:06:45 +04:00
];
2023-07-05 22:32:26 +04:00
};
2023-07-26 12:06:37 +04:00
sakopc = nixpkgs.lib.nixosSystem {
2023-08-07 17:28:33 +04:00
specialArgs = {inherit inputs outputs;};
2023-07-26 12:06:37 +04:00
modules = [
2023-08-07 17:28:33 +04:00
./default.nix
2023-07-26 12:06:37 +04:00
./hosts/sakopc/configuration.nix
];
};
sakowsl = nixpkgs.lib.nixosSystem {
2023-08-19 11:20:34 +04:00
# because theres no hardware-configuration.nix
system = "x86_64-linux";
specialArgs = {inherit inputs outputs;};
modules = [
{nix.registry.nixpkgs.flake = nixpkgs;}
./hosts/sakowsl/configuration.nix
NixOS-WSL.nixosModules.wsl
2023-08-23 18:34:42 +04:00
sops-nix.nixosModules.sops
2023-08-19 11:20:34 +04:00
];
};
2023-07-05 22:32:26 +04:00
};
};
}