blob: 9bd5ceeb7948d479c2a87bb5bc8ad4921a9b3342 [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 Grey25b96522022-08-09 09:00:52 +010015 nushell-066.url = "github:nixos/nixpkgs/19091dedfef6f3211c27b2e970cf24921b4212e3";
Skyler Greycecd9792022-07-27 14:38:47 +010016 fzf-tab = {
17 url = "github:Aloxaf/fzf-tab";
18 flake = false;
19 };
Skyler Greyd4c48672022-08-04 16:19:48 +010020 git-confirm = {
21 url = "github:pimterry/git-confirm";
22 flake = false;
23 };
Skyler Turner0ab3b7f2022-03-04 23:24:10 +000024
25 # Make sure flakes we depend on use the same version of nixpkgs as we do
26 home-manager.inputs.nixpkgs.follows = "nixpkgs";
Skyler Turner62330c12022-03-04 22:10:16 +000027 };
Skyler Turner85ddd892022-03-04 10:21:38 +000028
Skyler Greyf11bbb62022-07-29 08:55:08 +010029 outputs = extraInputs@{ self, nixpkgs, nixpkgs-unstable, nixpkgs-21-11, home-manager, ... }:
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000030 let
31 system = "x86_64-linux"; # TOOD: Add options for MacOS
Skyler Turner85ddd892022-03-04 10:21:38 +000032
Skyler Grey30817a72022-07-21 00:36:23 +010033 unstable-overlays = import ./src/utils/nixFilesIn.nix nixpkgs-unstable.lib ./src/unstable-overlays;
34
Skyler Turnerb03a4012022-03-04 22:38:22 +000035 pkgs = import nixpkgs {
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000036 inherit system;
37
Skyler Grey1e5be0e2022-07-25 13:34:13 +010038 config = { allowUnfree = true; };
Skyler Grey25b96522022-08-09 09:00:52 +010039
40 overlays = [
41 (final: prev: { nushell = prev.callPackage "${extraInputs.nushell-066}/pkgs/shells/nushell" { inherit (prev.darwin.apple_sdk.frameworks) AppKit Security; }; })
42 ];
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000043 };
44
Skyler Grey4e7e66e2022-05-24 20:29:52 +010045 pkgs-unstable = import nixpkgs-unstable {
46 inherit system;
47
Skyler Grey30817a72022-07-21 00:36:23 +010048 overlays = map (f: import f) unstable-overlays;
Skyler Grey1e5be0e2022-07-25 13:34:13 +010049 config = { allowUnfree = true; };
Skyler Grey4e7e66e2022-05-24 20:29:52 +010050 };
51
Skyler Greyf11bbb62022-07-29 08:55:08 +010052 pkgs-21-11 = import nixpkgs-21-11 {
53 inherit system;
54
55 config = { allowUnfree = true; };
56 };
57
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000058 variables = import ./src/common/variables.nix;
59 in {
Skyler Grey677635f2022-05-18 21:58:58 +010060 nixosConfigurations = {
Skyler Grey16d536e2022-05-18 22:00:59 +010061 default = nixpkgs.lib.nixosSystem {
Skyler Grey395d6282022-05-19 06:56:49 +010062 inherit system;
63
Skyler Greye11b9a72022-05-31 14:29:27 +010064 specialArgs = extraInputs // {
Skyler Greyf11bbb62022-07-29 08:55:08 +010065 inherit nixpkgs nixpkgs-unstable home-manager pkgs-unstable pkgs-21-11 system;
Skyler Greyf93dd5a2022-05-19 06:56:58 +010066 };
Skyler Turner85ddd892022-03-04 10:21:38 +000067
Skyler Grey677635f2022-05-18 21:58:58 +010068 modules = [
69 src/system.nix
70 ];
71 };
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000072 };
Skyler Turner62330c12022-03-04 22:10:16 +000073
Skyler Grey1ec54612022-05-22 07:14:17 +010074 homeConfigurations = {
Skyler Greyb05fb742022-05-22 07:15:17 +010075 "${variables.username}" = home-manager.lib.homeManagerConfiguration rec {
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000076 inherit system pkgs;
Skyler Turner62330c12022-03-04 22:10:16 +000077
Skyler Greyf11bbb62022-07-29 08:55:08 +010078 extraSpecialArgs = extraInputs // { inherit nixpkgs nixpkgs-unstable home-manager pkgs-unstable pkgs-21-11 system; };
Skyler Greyc7213502022-05-21 21:12:24 +010079
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000080 username = variables.username;
81 homeDirectory = "/home/${username}";
Skyler Turner0ab3b7f2022-03-04 23:24:10 +000082 stateVersion = variables.stateVersion;
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000083
84 configuration = {
85 imports = [
86 src/home.nix
Skyler Turner62330c12022-03-04 22:10:16 +000087 ];
Skyler Turner0ab3b7f2022-03-04 23:24:10 +000088
89 programs.home-manager.enable = true;
90 # Although I don't do any other configuration here directly,
91 # this is needed to make home-manager work and so *must* be
92 # present on every home manager configuration.
Skyler Turner20445bd2022-03-04 22:22:57 +000093 };
Skyler Turner62330c12022-03-04 22:10:16 +000094 };
Skyler Turner62330c12022-03-04 22:10:16 +000095 };
96 };
Skyler Turner85ddd892022-03-04 10:21:38 +000097}