nix-dotfiles/flake.nix

115 lines
2.4 KiB
Nix
Raw Normal View History

2022-03-07 16:01:52 +01:00
{
description = "Mmmmmh, Spaghetti";
inputs = {
nixpkgs.url = "nixpkgs/nixos-21.11";
home-manager = {
url = "github:nix-community/home-manager/release-21.11";
inputs.nixpkgs.follows = "nixpkgs";
};
2022-03-22 16:37:19 +01:00
dotfiles = {
url = "github:h7x4abk3g/dotfiles";
flake = false;
};
2022-03-07 16:01:52 +01:00
2022-03-22 23:05:42 +01:00
website = {
url = "git+https://git.nani.wtf/h7x4/nani.wtf?ref=main";
# url = "path:/home/h7x4/git/nani.wtf";
inputs.nixpkgs.follows = "nixpkgs";
};
2022-03-07 16:01:52 +01:00
# Nix expressions and keys (TODO: move keys to another solution like agenix)
# which should be kept from the main repo for privacy reasons.
#
# Includes stuff like usernames, emails, ports, other server users, ssh hosts, etc.
secrets = {
# TODO: Push this to a remote.
url = "git+file:///home/h7x4/git/nix-secrets";
inputs.nixpkgs.follows = "nixpkgs";
};
};
2022-03-22 23:05:42 +01:00
outputs = {
self,
nixpkgs,
home-manager,
secrets,
dotfiles,
website,
...
}: let
2022-03-07 16:01:52 +01:00
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config = {
allowUnfree = true;
android_sdk.accept_license = true;
};
overlays = [ (import ./overlays/lib) ];
};
specialArgs = {
secrets = secrets.outputs.default;
colorTheme = import ./common/colors.nix;
2022-03-22 16:37:19 +01:00
inputs = {
2022-03-22 23:05:42 +01:00
inherit home-manager;
inherit dotfiles;
inherit website;
inherit secrets;
2022-03-22 16:37:19 +01:00
};
2022-03-07 16:01:52 +01:00
};
in {
overlays = {
lib = import ./overlays/lib;
};
homeConfigurations = {
h7x4 = home-manager.lib.homeManagerConfiguration {
inherit system;
inherit pkgs;
extraSpecialArgs = specialArgs;
username = "h7x4";
homeDirectory = "/home/h7x4";
stateVersion = "21.11";
configuration = {
imports = [
./home.nix
secrets.outputs.nixosModule
];
};
};
};
nixosConfigurations = let
# String -> AttrSet -> AttrSet
nixSys =
name: extraOpts:
nixpkgs.lib.nixosSystem {
inherit system;
inherit pkgs;
lib = pkgs.lib;
inherit specialArgs;
modules = [
./hosts/${name}/configuration.nix
];
} // extraOpts;
in {
Tsuki = nixSys "tsuki" {};
Eisei = nixSys "eisei" {};
2022-03-22 16:37:19 +01:00
kasei = nixSys "kasei" {};
2022-03-07 16:01:52 +01:00
};
};
}