blob: a90cc5438f65d9d898915c27c8c165bde7951d67 [file] [log] [blame]
Skyler Turner85ddd892022-03-04 10:21:38 +00001{
Skyler Turner62330c12022-03-04 22:10:16 +00002 description = "Minion3665's NixFiles (since 2022-03-24)";
Skyler Turner85ddd892022-03-04 10:21:38 +00003
Skyler Turner62330c12022-03-04 22:10:16 +00004 inputs = {
Skyler Grey53aad5e2022-07-24 20:19:08 +01005 registry = {
6 url = "github:nixos/flake-registry";
7 flake = false;
8 };
Skyler Greya239bbe2022-05-30 23:08:02 +01009 nixpkgs.url = "github:nixos/nixpkgs/nixos-22.05";
Skyler Greyf8cca8f2022-05-24 20:17:21 +010010 nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
Skyler Greyf11bbb62022-07-29 08:55:08 +010011 nixpkgs-21-11.url = "github:nixos/nixpkgs/nixos-21.11";
Skyler Greya239bbe2022-05-30 23:08:02 +010012 home-manager.url = "github:nix-community/home-manager/release-22.05";
Skyler Greyc7213502022-05-21 21:12:24 +010013 nurpkgs.url = "github:nix-community/NUR";
14 comma.url = "github:nix-community/comma";
Skyler Greycecd9792022-07-27 14:38:47 +010015 fzf-tab = {
16 url = "github:Aloxaf/fzf-tab";
17 flake = false;
18 };
Skyler Turner0ab3b7f2022-03-04 23:24:10 +000019
20 # Make sure flakes we depend on use the same version of nixpkgs as we do
21 home-manager.inputs.nixpkgs.follows = "nixpkgs";
Skyler Turner62330c12022-03-04 22:10:16 +000022 };
Skyler Turner85ddd892022-03-04 10:21:38 +000023
Skyler Greyf11bbb62022-07-29 08:55:08 +010024 outputs = extraInputs@{ self, nixpkgs, nixpkgs-unstable, nixpkgs-21-11, home-manager, ... }:
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000025 let
26 system = "x86_64-linux"; # TOOD: Add options for MacOS
Skyler Turner85ddd892022-03-04 10:21:38 +000027
Skyler Grey30817a72022-07-21 00:36:23 +010028 unstable-overlays = import ./src/utils/nixFilesIn.nix nixpkgs-unstable.lib ./src/unstable-overlays;
29
Skyler Turnerb03a4012022-03-04 22:38:22 +000030 pkgs = import nixpkgs {
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000031 inherit system;
32
Skyler Grey1e5be0e2022-07-25 13:34:13 +010033 config = { allowUnfree = true; };
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000034 };
35
Skyler Grey4e7e66e2022-05-24 20:29:52 +010036 pkgs-unstable = import nixpkgs-unstable {
37 inherit system;
38
Skyler Grey30817a72022-07-21 00:36:23 +010039 overlays = map (f: import f) unstable-overlays;
Skyler Grey1e5be0e2022-07-25 13:34:13 +010040 config = { allowUnfree = true; };
Skyler Grey4e7e66e2022-05-24 20:29:52 +010041 };
42
Skyler Greyf11bbb62022-07-29 08:55:08 +010043 pkgs-21-11 = import nixpkgs-21-11 {
44 inherit system;
45
46 config = { allowUnfree = true; };
47 };
48
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000049 variables = import ./src/common/variables.nix;
50 in {
Skyler Grey677635f2022-05-18 21:58:58 +010051 nixosConfigurations = {
Skyler Grey16d536e2022-05-18 22:00:59 +010052 default = nixpkgs.lib.nixosSystem {
Skyler Grey395d6282022-05-19 06:56:49 +010053 inherit system;
54
Skyler Greye11b9a72022-05-31 14:29:27 +010055 specialArgs = extraInputs // {
Skyler Greyf11bbb62022-07-29 08:55:08 +010056 inherit nixpkgs nixpkgs-unstable home-manager pkgs-unstable pkgs-21-11 system;
Skyler Greyf93dd5a2022-05-19 06:56:58 +010057 };
Skyler Turner85ddd892022-03-04 10:21:38 +000058
Skyler Grey677635f2022-05-18 21:58:58 +010059 modules = [
60 src/system.nix
61 ];
62 };
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000063 };
Skyler Turner62330c12022-03-04 22:10:16 +000064
Skyler Grey1ec54612022-05-22 07:14:17 +010065 homeConfigurations = {
Skyler Greyb05fb742022-05-22 07:15:17 +010066 "${variables.username}" = home-manager.lib.homeManagerConfiguration rec {
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000067 inherit system pkgs;
Skyler Turner62330c12022-03-04 22:10:16 +000068
Skyler Greyf11bbb62022-07-29 08:55:08 +010069 extraSpecialArgs = extraInputs // { inherit nixpkgs nixpkgs-unstable home-manager pkgs-unstable pkgs-21-11 system; };
Skyler Greyc7213502022-05-21 21:12:24 +010070
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000071 username = variables.username;
72 homeDirectory = "/home/${username}";
Skyler Turner0ab3b7f2022-03-04 23:24:10 +000073 stateVersion = variables.stateVersion;
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000074
75 configuration = {
76 imports = [
77 src/home.nix
Skyler Turner62330c12022-03-04 22:10:16 +000078 ];
Skyler Turner0ab3b7f2022-03-04 23:24:10 +000079
80 programs.home-manager.enable = true;
81 # Although I don't do any other configuration here directly,
82 # this is needed to make home-manager work and so *must* be
83 # present on every home manager configuration.
Skyler Turner20445bd2022-03-04 22:22:57 +000084 };
Skyler Turner62330c12022-03-04 22:10:16 +000085 };
Skyler Turner62330c12022-03-04 22:10:16 +000086 };
87 };
Skyler Turner85ddd892022-03-04 10:21:38 +000088}