nix-dotfiles/flake.nix

239 lines
6.0 KiB
Nix
Raw Normal View History

2022-03-07 16:01:52 +01:00
{
inputs = {
nixpkgs.url = "nixpkgs/nixos-24.05";
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
2022-03-07 16:01:52 +01:00
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
2022-03-07 16:01:52 +01:00
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager-local = {
url = "git+file:///home/h7x4/git/home-manager";
inputs.nixpkgs.follows = "nixpkgs-unstable";
};
2022-03-22 16:37:19 +01:00
dotfiles = {
2024-06-02 16:22:38 +02:00
url = "git+https://git.pvv.ntnu.no/oysteikt/dotfiles?ref=master";
2022-03-22 16:37:19 +01:00
flake = false;
};
2022-03-07 16:01:52 +01:00
fonts = {
url = "path:/home/h7x4/git/fonts";
flake = false;
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
2023-03-07 23:08:39 +01:00
2023-01-04 14:32:11 +01:00
osuchan = {
url = "git+file:///home/h7x4/git/osuchan-line-bot";
inputs.nixpkgs.follows = "nixpkgs";
2023-01-04 14:32:11 +01:00
};
# TODO: fix website
# website = {
# url = "git+https://git.pvv.ntnu.no/oysteikt/nani.wtf?ref=main";
2022-03-22 23:05:42 +01:00
# url = "path:/home/h7x4/git/nani.wtf";
# inputs.nixpkgs.follows = "nixpkgs";
# };
2022-03-22 23:05:42 +01:00
2023-01-03 22:45:41 +01:00
maunium-stickerpicker = {
url = "github:h7x4/maunium-stickerpicker-nix/0.1.0";
inputs.nixpkgs.follows = "nixpkgs";
2023-01-03 22:45:41 +01:00
};
2023-01-16 16:06:34 +01:00
minecraft = {
url = "github:infinidoge/nix-minecraft";
inputs.nixpkgs.follows = "nixpkgs-unstable";
2023-01-16 16:06:34 +01:00
};
matrix-synapse-next = {
url = "github:dali99/nixos-matrix-modules/v0.6.0";
inputs.nixpkgs.follows = "nixpkgs";
};
vscode-server = {
url = "github:nix-community/nixos-vscode-server";
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";
};
};
outputs = inputs@{
2022-03-22 23:05:42 +01:00
self,
nixpkgs,
nixpkgs-unstable,
2022-03-22 23:05:42 +01:00
home-manager,
home-manager-local,
dotfiles,
fonts,
matrix-synapse-next,
2023-01-03 22:45:41 +01:00
maunium-stickerpicker,
2023-01-16 16:06:34 +01:00
minecraft,
osuchan,
secrets,
2023-03-07 23:08:39 +01:00
sops-nix,
vscode-server,
# website
2022-03-22 23:05:42 +01:00
}: let
2022-03-07 16:01:52 +01:00
system = "x86_64-linux";
pkgs-config = {
2022-03-07 16:01:52 +01:00
inherit system;
config = {
allowUnfree = true;
android_sdk.accept_license = true;
};
overlays = let
nonrecursive-unstable-pkgs = import nixpkgs-unstable {
inherit system;
config.allowUnfree = true;
};
in [
2024-06-02 16:40:31 +02:00
# (self: super: { pcloud = nonrecursive-unstable-pkgs.pcloud; })
2024-06-10 00:51:20 +02:00
minecraft.overlays.default
osuchan.overlays.default
(self: super: {
mpv-unwrapped = super.mpv-unwrapped.override {
2023-12-18 20:59:48 +01:00
ffmpeg = super.ffmpeg_6-full;
};
})
];
2022-08-18 23:15:50 +02:00
};
pkgs = import nixpkgs pkgs-config;
unstable-pkgs = import nixpkgs-unstable pkgs-config;
2022-03-07 16:01:52 +01:00
in {
extendedLib = import ./lib { stdlib = pkgs.lib; };
inherit pkgs;
packages.${system} = {
inherit (pkgs) kanidm pcloud;
};
2023-03-07 23:08:39 +01:00
devShells.${system}.default = pkgs.mkShell {
packages = with pkgs; [ sops ];
};
2022-03-07 16:01:52 +01:00
homeConfigurations = {
h7x4 = home-manager.lib.homeManagerConfiguration {
inherit system;
inherit pkgs;
username = "h7x4";
homeDirectory = "/home/h7x4";
2022-06-12 00:23:10 +02:00
stateVersion = "22.05";
2022-03-07 16:01:52 +01:00
configuration = {
imports = [
./home/home.nix
./modules/machineVars.nix
2022-03-07 16:01:52 +01:00
];
machineVars = {
headless = false;
fixDisplayCommand = "echo 'not available'";
gaming = true;
development = true;
laptop = false;
};
2022-03-07 16:01:52 +01:00
};
};
};
nixosConfigurations = let
nixSys = name:
2022-03-07 16:01:52 +01:00
nixpkgs.lib.nixosSystem {
inherit system;
inherit pkgs;
inherit (pkgs) lib;
2022-03-07 16:01:52 +01:00
modules = [
"${home-manager}/nixos"
./modules/machineVars.nix
./modules/socketActivation.nix
./hosts/common.nix
2022-03-07 16:01:52 +01:00
./hosts/${name}/configuration.nix
2023-12-18 20:59:48 +01:00
matrix-synapse-next.nixosModules.default
osuchan.outputs.nixosModules.default
secrets.outputs.nixos-config
2023-03-07 23:08:39 +01:00
sops-nix.nixosModules.sops
vscode-server.nixosModules.default
maunium-stickerpicker.nixosModules.default
(args: import minecraft.outputs.nixosModules.minecraft-servers (args // {
pkgs = unstable-pkgs;
lib = unstable-pkgs.lib;
}))
2022-08-18 23:15:50 +02:00
{
config._module.args = {
inherit inputs;
inherit unstable-pkgs;
inherit (self) extendedLib;
secrets = secrets.outputs.settings;
2022-08-18 23:15:50 +02:00
};
}
({ config, ... }:
{
home-manager = {
useGlobalPkgs = true;
extraSpecialArgs = {
inherit inputs;
inherit (self) extendedLib;
inherit (config) machineVars;
2024-06-25 20:10:58 +02:00
hostname = name;
secrets = secrets.outputs.settings;
};
2024-06-25 20:10:58 +02:00
sharedModules = [
inputs.sops-nix.homeManagerModules.sops
];
users.h7x4 = {
imports = [ ./home/home.nix ];
};
};
})
2022-03-07 16:01:52 +01:00
];
};
2022-03-07 16:01:52 +01:00
in {
2024-01-23 05:33:48 +01:00
tsuki = nixSys "tsuki";
Eisei = nixSys "eisei";
kasei = nixSys "kasei";
2022-11-19 21:27:31 +01:00
home-manager-tester = nixpkgs-unstable.lib.nixosSystem {
inherit system;
pkgs = unstable-pkgs;
inherit (unstable-pkgs) lib;
modules = [
"${home-manager-local}/nixos"
./hosts/special/home-manager-tester/configuration.nix
{
config._module.args = {
pkgs = unstable-pkgs;
# inherit (self) extendedLib;
# secrets = secrets.outputs.settings;
};
}
];
};
2022-03-07 16:01:52 +01:00
};
};
}