blob: 6a97d958c6d7adce187885546fc9c33eb4a8e8ed [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 Greya239bbe2022-05-30 23:08:02 +010011 home-manager.url = "github:nix-community/home-manager/release-22.05";
Skyler Greyc7213502022-05-21 21:12:24 +010012 nurpkgs.url = "github:nix-community/NUR";
13 comma.url = "github:nix-community/comma";
Skyler Greycecd9792022-07-27 14:38:47 +010014 fzf-tab = {
15 url = "github:Aloxaf/fzf-tab";
16 flake = false;
17 };
Skyler Turner0ab3b7f2022-03-04 23:24:10 +000018
19 # Make sure flakes we depend on use the same version of nixpkgs as we do
20 home-manager.inputs.nixpkgs.follows = "nixpkgs";
Skyler Turner62330c12022-03-04 22:10:16 +000021 };
Skyler Turner85ddd892022-03-04 10:21:38 +000022
Skyler Grey92425512022-05-24 20:30:39 +010023 outputs = extraInputs@{ self, nixpkgs, nixpkgs-unstable, home-manager, ... }:
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000024 let
25 system = "x86_64-linux"; # TOOD: Add options for MacOS
Skyler Turner85ddd892022-03-04 10:21:38 +000026
Skyler Grey30817a72022-07-21 00:36:23 +010027 unstable-overlays = import ./src/utils/nixFilesIn.nix nixpkgs-unstable.lib ./src/unstable-overlays;
28
Skyler Turnerb03a4012022-03-04 22:38:22 +000029 pkgs = import nixpkgs {
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000030 inherit system;
31
Skyler Grey1e5be0e2022-07-25 13:34:13 +010032 config = { allowUnfree = true; };
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000033 };
34
Skyler Grey4e7e66e2022-05-24 20:29:52 +010035 pkgs-unstable = import nixpkgs-unstable {
36 inherit system;
37
Skyler Grey30817a72022-07-21 00:36:23 +010038 overlays = map (f: import f) unstable-overlays;
Skyler Grey1e5be0e2022-07-25 13:34:13 +010039 config = { allowUnfree = true; };
Skyler Grey4e7e66e2022-05-24 20:29:52 +010040 };
41
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000042 variables = import ./src/common/variables.nix;
43 in {
Skyler Grey677635f2022-05-18 21:58:58 +010044 nixosConfigurations = {
Skyler Grey16d536e2022-05-18 22:00:59 +010045 default = nixpkgs.lib.nixosSystem {
Skyler Grey395d6282022-05-19 06:56:49 +010046 inherit system;
47
Skyler Greye11b9a72022-05-31 14:29:27 +010048 specialArgs = extraInputs // {
Skyler Grey6b155862022-07-21 00:22:20 +010049 inherit nixpkgs nixpkgs-unstable home-manager pkgs-unstable system;
Skyler Greyf93dd5a2022-05-19 06:56:58 +010050 };
Skyler Turner85ddd892022-03-04 10:21:38 +000051
Skyler Grey677635f2022-05-18 21:58:58 +010052 modules = [
53 src/system.nix
54 ];
55 };
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000056 };
Skyler Turner62330c12022-03-04 22:10:16 +000057
Skyler Grey1ec54612022-05-22 07:14:17 +010058 homeConfigurations = {
Skyler Greyb05fb742022-05-22 07:15:17 +010059 "${variables.username}" = home-manager.lib.homeManagerConfiguration rec {
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000060 inherit system pkgs;
Skyler Turner62330c12022-03-04 22:10:16 +000061
Skyler Grey6b155862022-07-21 00:22:20 +010062 extraSpecialArgs = extraInputs // { inherit nixpkgs nixpkgs-unstable home-manager pkgs-unstable system; };
Skyler Greyc7213502022-05-21 21:12:24 +010063
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000064 username = variables.username;
65 homeDirectory = "/home/${username}";
Skyler Turner0ab3b7f2022-03-04 23:24:10 +000066 stateVersion = variables.stateVersion;
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000067
68 configuration = {
69 imports = [
70 src/home.nix
Skyler Turner62330c12022-03-04 22:10:16 +000071 ];
Skyler Turner0ab3b7f2022-03-04 23:24:10 +000072
73 programs.home-manager.enable = true;
74 # Although I don't do any other configuration here directly,
75 # this is needed to make home-manager work and so *must* be
76 # present on every home manager configuration.
Skyler Turner20445bd2022-03-04 22:22:57 +000077 };
Skyler Turner62330c12022-03-04 22:10:16 +000078 };
Skyler Turner62330c12022-03-04 22:10:16 +000079 };
80 };
Skyler Turner85ddd892022-03-04 10:21:38 +000081}