blob: 210ef96d6d906b317047a91d9fd78e50d637c0de [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 Greya239bbe2022-05-30 23:08:02 +01005 nixpkgs.url = "github:nixos/nixpkgs/nixos-22.05";
Skyler Greyf8cca8f2022-05-24 20:17:21 +01006 nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
Skyler Greyf0b68e42022-07-17 10:18:58 +01007 nixpkgs-mongodb-fix.url = "github:Et7f3/nixpkgs/fix-mongodb";
Skyler Greya239bbe2022-05-30 23:08:02 +01008 home-manager.url = "github:nix-community/home-manager/release-22.05";
Skyler Greyc7213502022-05-21 21:12:24 +01009 nurpkgs.url = "github:nix-community/NUR";
10 comma.url = "github:nix-community/comma";
Skyler Turner0ab3b7f2022-03-04 23:24:10 +000011
12 # Make sure flakes we depend on use the same version of nixpkgs as we do
13 home-manager.inputs.nixpkgs.follows = "nixpkgs";
Skyler Turner62330c12022-03-04 22:10:16 +000014 };
Skyler Turner85ddd892022-03-04 10:21:38 +000015
Skyler Grey92425512022-05-24 20:30:39 +010016 outputs = extraInputs@{ self, nixpkgs, nixpkgs-unstable, home-manager, ... }:
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000017 let
18 system = "x86_64-linux"; # TOOD: Add options for MacOS
Skyler Turner85ddd892022-03-04 10:21:38 +000019
Skyler Turnerb03a4012022-03-04 22:38:22 +000020 pkgs = import nixpkgs {
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000021 inherit system;
22
23 config = { allowUnfree = true; };
24 };
25
Skyler Grey4e7e66e2022-05-24 20:29:52 +010026 pkgs-unstable = import nixpkgs-unstable {
27 inherit system;
28
29 config = { allowUnfree = true; };
30 };
31
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000032 variables = import ./src/common/variables.nix;
33 in {
Skyler Grey677635f2022-05-18 21:58:58 +010034 nixosConfigurations = {
Skyler Grey16d536e2022-05-18 22:00:59 +010035 default = nixpkgs.lib.nixosSystem {
Skyler Grey395d6282022-05-19 06:56:49 +010036 inherit system;
37
Skyler Greye11b9a72022-05-31 14:29:27 +010038 specialArgs = extraInputs // {
Skyler Grey58d12a62022-06-07 19:02:00 +010039 inherit nixpkgs system;
Skyler Greyf93dd5a2022-05-19 06:56:58 +010040 };
Skyler Turner85ddd892022-03-04 10:21:38 +000041
Skyler Grey677635f2022-05-18 21:58:58 +010042 modules = [
43 src/system.nix
44 ];
45 };
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000046 };
Skyler Turner62330c12022-03-04 22:10:16 +000047
Skyler Grey1ec54612022-05-22 07:14:17 +010048 homeConfigurations = {
Skyler Greyb05fb742022-05-22 07:15:17 +010049 "${variables.username}" = home-manager.lib.homeManagerConfiguration rec {
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000050 inherit system pkgs;
Skyler Turner62330c12022-03-04 22:10:16 +000051
Skyler Grey58d12a62022-06-07 19:02:00 +010052 extraSpecialArgs = extraInputs // { inherit pkgs-unstable system; };
Skyler Greyc7213502022-05-21 21:12:24 +010053
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000054 username = variables.username;
55 homeDirectory = "/home/${username}";
Skyler Turner0ab3b7f2022-03-04 23:24:10 +000056 stateVersion = variables.stateVersion;
Skyler Turnerc7a1e2f2022-03-04 22:23:50 +000057
58 configuration = {
59 imports = [
60 src/home.nix
Skyler Turner62330c12022-03-04 22:10:16 +000061 ];
Skyler Turner0ab3b7f2022-03-04 23:24:10 +000062
63 programs.home-manager.enable = true;
64 # Although I don't do any other configuration here directly,
65 # this is needed to make home-manager work and so *must* be
66 # present on every home manager configuration.
Skyler Turner20445bd2022-03-04 22:22:57 +000067 };
Skyler Turner62330c12022-03-04 22:10:16 +000068 };
Skyler Turner62330c12022-03-04 22:10:16 +000069 };
70 };
Skyler Turner85ddd892022-03-04 10:21:38 +000071}