2021-10-26 18:25:19 +00:00
|
|
|
{
|
2021-10-28 22:15:24 +00:00
|
|
|
description = "nki's systems";
|
2021-10-26 18:25:19 +00:00
|
|
|
|
|
|
|
inputs = {
|
2021-12-01 18:52:13 +00:00
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/21.11";
|
2021-10-26 18:25:19 +00:00
|
|
|
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
|
|
|
darwin.url = "github:lnl7/nix-darwin/master";
|
|
|
|
darwin.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
2021-12-01 18:52:13 +00:00
|
|
|
home-manager.url = "github:nix-community/home-manager/release-21.11";
|
|
|
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
2021-10-28 22:15:24 +00:00
|
|
|
sops-nix.url = "github:Mic92/sops-nix";
|
2021-10-31 19:06:44 +00:00
|
|
|
deploy-rs.url = "github:Serokell/deploy-rs";
|
2021-10-28 22:15:24 +00:00
|
|
|
nur.url = "github:nix-community/NUR";
|
2021-10-29 04:25:58 +00:00
|
|
|
|
|
|
|
# ---
|
|
|
|
# Imported apps
|
2021-10-29 17:31:16 +00:00
|
|
|
naersk.url = "github:nix-community/naersk";
|
2021-10-29 04:25:58 +00:00
|
|
|
rnix-lsp.url = "github:nix-community/rnix-lsp";
|
2021-10-29 17:31:16 +00:00
|
|
|
rnix-lsp.inputs.naersk.follows = "naersk";
|
|
|
|
rnix-lsp.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
2021-11-03 19:01:23 +00:00
|
|
|
youmubot.url = "github:natsukagami/youmubot";
|
2021-12-09 20:54:26 +00:00
|
|
|
nix-gaming.url = github:fufexan/nix-gaming;
|
2021-11-03 22:42:02 +00:00
|
|
|
|
|
|
|
# ---
|
|
|
|
# DEPLOYMENT ONLY! secrets
|
|
|
|
secrets.url = "git+ssh://git@github.com/natsukagami/nix-deploy-secrets";
|
2021-10-26 18:25:19 +00:00
|
|
|
};
|
|
|
|
|
2021-12-01 18:52:13 +00:00
|
|
|
outputs = { self, darwin, nixpkgs, nixpkgs-unstable, home-manager, deploy-rs, sops-nix, nur, ... }@inputs:
|
2021-10-29 17:31:16 +00:00
|
|
|
let
|
|
|
|
overlayForSystem = import ./overlay.nix inputs;
|
2021-12-09 20:54:26 +00:00
|
|
|
|
|
|
|
nixpkgsAsRegistry = { ... }: {
|
|
|
|
nix.registry.nixpkgs.flake = nixpkgs;
|
|
|
|
nix.registry.nixpkgs-unstable.flake = nixpkgs-unstable;
|
|
|
|
nix.nixPath = [
|
|
|
|
"nixpkgs=${nixpkgs}"
|
|
|
|
"nixpkgs-unstable=${nixpkgs-unstable}"
|
|
|
|
"/nix/var/nix/profiles/per-user/root/channels"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
enableOsuStable = { lib, ... }: {
|
|
|
|
imports = [ inputs.nix-gaming.nixosModules.pipewireLowLatency ];
|
|
|
|
|
|
|
|
services.pipewire = {
|
|
|
|
enable = true;
|
|
|
|
# alsa is optional
|
|
|
|
alsa.enable = true;
|
|
|
|
alsa.support32Bit = true;
|
|
|
|
# needed for osu
|
|
|
|
pulse.enable = true;
|
|
|
|
lowLatency.enable = true;
|
|
|
|
};
|
|
|
|
hardware.pulseaudio.enable = lib.mkOverride 0 false;
|
|
|
|
|
|
|
|
nix.binaryCaches = [ "https://nix-gaming.cachix.org" ];
|
|
|
|
nix.binaryCachePublicKeys = [ "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=" ];
|
|
|
|
|
|
|
|
environment.systemPackages = [ inputs.nix-gaming.packages.x86_64-linux.osu-stable ];
|
|
|
|
};
|
2021-10-29 17:31:16 +00:00
|
|
|
in
|
|
|
|
{
|
|
|
|
# MacBook configuration: nix-darwin + home-manager
|
|
|
|
darwinConfigurations."nki-macbook" = darwin.lib.darwinSystem {
|
|
|
|
system = "aarch64-darwin";
|
|
|
|
modules = [
|
|
|
|
./darwin/configuration.nix
|
2021-12-01 18:52:13 +00:00
|
|
|
home-manager.darwinModules.home-manager
|
2021-10-26 18:25:19 +00:00
|
|
|
{
|
|
|
|
home-manager.useGlobalPkgs = true;
|
|
|
|
home-manager.useUserPackages = true;
|
2021-10-27 16:35:53 +00:00
|
|
|
home-manager.users.nki = import ./home/macbook-home.nix;
|
2021-10-29 17:31:16 +00:00
|
|
|
}
|
|
|
|
(overlayForSystem "aarch64-darwin")
|
|
|
|
];
|
|
|
|
};
|
2021-10-28 22:15:24 +00:00
|
|
|
|
2021-10-29 17:31:16 +00:00
|
|
|
# Home configuration
|
|
|
|
nixosConfigurations."nki-home" = nixpkgs.lib.nixosSystem {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
|
|
|
./modules/my-tinc
|
|
|
|
sops-nix.nixosModules.sops
|
|
|
|
./nki-home/configuration.nix
|
2021-12-09 20:54:26 +00:00
|
|
|
nixpkgsAsRegistry
|
|
|
|
enableOsuStable
|
2021-12-01 18:52:13 +00:00
|
|
|
home-manager.nixosModules.home-manager
|
2021-10-29 17:31:16 +00:00
|
|
|
{
|
|
|
|
home-manager.useGlobalPkgs = true;
|
|
|
|
home-manager.useUserPackages = true;
|
|
|
|
home-manager.users.nki = import ./home/kagami-pc-home.nix;
|
|
|
|
}
|
|
|
|
(overlayForSystem "x86_64-linux")
|
|
|
|
];
|
|
|
|
};
|
2021-10-31 19:06:44 +00:00
|
|
|
|
|
|
|
# DigitalOcean node
|
|
|
|
nixosConfigurations."nki-personal-do" = nixpkgs.lib.nixosSystem {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
|
|
|
./modules/my-tinc
|
2021-11-03 17:22:27 +00:00
|
|
|
inputs.youmubot.nixosModule.x86_64-linux
|
2021-10-31 19:06:44 +00:00
|
|
|
sops-nix.nixosModules.sops
|
|
|
|
./nki-personal-do/configuration.nix
|
2021-11-03 22:42:02 +00:00
|
|
|
inputs.secrets.nixosModules.x86_64-linux.nki-personal-do
|
2021-11-01 01:41:29 +00:00
|
|
|
(overlayForSystem "x86_64-linux")
|
2021-10-31 19:06:44 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
deploy.nodes."nki-personal-do" = {
|
|
|
|
hostname = "nki-personal-do";
|
|
|
|
sshUser = "root";
|
|
|
|
profiles.system = {
|
|
|
|
user = "root";
|
|
|
|
path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations."nki-personal-do";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# This is highly advised, and will prevent many possible mistakes
|
|
|
|
checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
|
|
|
|
|
2021-10-26 18:25:19 +00:00
|
|
|
};
|
|
|
|
}
|