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 = {
|
2023-06-03 11:39:55 +00:00
|
|
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
|
2023-04-18 23:09:20 +00:00
|
|
|
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
2021-10-26 18:25:19 +00:00
|
|
|
darwin.url = "github:lnl7/nix-darwin/master";
|
|
|
|
darwin.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
2023-06-03 11:39:55 +00:00
|
|
|
home-manager.url = "github:nix-community/home-manager/release-23.05";
|
2021-12-01 18:52:13 +00:00
|
|
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
2021-10-28 22:15:24 +00:00
|
|
|
sops-nix.url = "github:Mic92/sops-nix";
|
2022-11-14 14:25:54 +00:00
|
|
|
sops-nix.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
2022-12-05 09:59:59 +00:00
|
|
|
sops-nix.inputs.nixpkgs-stable.follows = "nixpkgs";
|
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
|
|
|
|
2023-08-30 21:53:14 +00:00
|
|
|
# --- Secure boot
|
|
|
|
lanzaboote = {
|
|
|
|
url = github:nix-community/lanzaboote/v0.3.0;
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
|
|
|
|
2022-09-02 21:07:53 +00:00
|
|
|
# --- Build tools
|
2022-05-31 16:45:33 +00:00
|
|
|
flake-utils.url = github:numtide/flake-utils;
|
2022-09-02 21:07:53 +00:00
|
|
|
crane.url = github:ipetkov/crane;
|
2023-04-26 21:23:28 +00:00
|
|
|
arion.url = github:hercules-ci/arion;
|
2022-05-31 16:45:33 +00:00
|
|
|
|
2021-10-29 04:25:58 +00:00
|
|
|
# ---
|
|
|
|
# Imported apps
|
|
|
|
rnix-lsp.url = "github:nix-community/rnix-lsp";
|
2023-11-21 13:57:05 +00:00
|
|
|
youmubot.url = "github:natsukagami/youmubot";
|
2023-03-23 10:17:12 +00:00
|
|
|
swayfx = {
|
|
|
|
url = github:WillPower3309/swayfx;
|
2023-06-06 20:36:45 +00:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
2023-03-23 10:17:12 +00:00
|
|
|
};
|
2023-03-31 08:26:13 +00:00
|
|
|
mpd-mpris = {
|
2023-09-17 10:56:21 +00:00
|
|
|
url = github:natsukagami/mpd-mpris;
|
2023-06-06 20:36:45 +00:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
2023-03-31 08:26:13 +00:00
|
|
|
};
|
2023-07-16 13:49:44 +00:00
|
|
|
dtth-phanpy.url = "git+ssh://gitea@git.dtth.ch/nki/phanpy";
|
2023-08-14 08:21:03 +00:00
|
|
|
conduit = {
|
2023-11-07 12:48:55 +00:00
|
|
|
url = gitlab:famedly/conduit/next;
|
2023-08-14 08:21:03 +00:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
|
|
|
};
|
2023-09-17 13:28:39 +00:00
|
|
|
eza.url = github:eza-community/eza/v0.12.0;
|
|
|
|
eza.inputs.nixpkgs.follows = "nixpkgs";
|
2023-09-26 20:31:25 +00:00
|
|
|
nix-gaming.url = github:fufexan/nix-gaming;
|
2021-11-03 22:42:02 +00:00
|
|
|
|
2022-07-06 20:26:50 +00:00
|
|
|
# --- Sources
|
2023-01-26 09:59:28 +00:00
|
|
|
kakoune.url = github:mawww/kakoune;
|
2022-07-06 20:26:50 +00:00
|
|
|
kakoune.flake = false;
|
2023-09-17 18:35:34 +00:00
|
|
|
kak-lsp.url = github:natsukagami/kak-lsp/metals-support;
|
2022-07-06 20:26:50 +00:00
|
|
|
kak-lsp.flake = false;
|
2023-06-16 11:08:01 +00:00
|
|
|
nixos-m1.url = github:tpwrules/nixos-apple-silicon;
|
2023-06-06 20:36:45 +00:00
|
|
|
nixos-m1.inputs.nixpkgs.follows = "nixpkgs";
|
2022-07-06 20:26:50 +00:00
|
|
|
|
2021-11-03 22:42:02 +00:00
|
|
|
# ---
|
|
|
|
# DEPLOYMENT ONLY! secrets
|
2022-06-10 02:41:37 +00:00
|
|
|
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
|
2022-07-04 19:41:04 +00:00
|
|
|
overlays = import ./overlay.nix inputs;
|
2023-04-18 11:03:19 +00:00
|
|
|
lib = nixpkgs.lib;
|
2021-12-09 20:54:26 +00:00
|
|
|
|
2023-04-18 11:03:19 +00:00
|
|
|
applyOverlays = { ... }: {
|
|
|
|
nixpkgs.overlays = lib.mkBefore overlays;
|
|
|
|
};
|
2022-07-04 19:41:04 +00:00
|
|
|
|
2023-04-18 11:03:19 +00:00
|
|
|
nixpkgsAsRegistry_ = stable: { lib, ... }: {
|
|
|
|
imports = [ applyOverlays ];
|
|
|
|
nix.registry.current-system.flake = self;
|
2022-07-04 19:41:04 +00:00
|
|
|
nix.registry.nixpkgs.flake = stable;
|
2021-12-09 20:54:26 +00:00
|
|
|
nix.registry.nixpkgs-unstable.flake = nixpkgs-unstable;
|
2023-04-18 22:13:43 +00:00
|
|
|
nixpkgs.config.allowUnfree = true;
|
2021-12-09 20:54:26 +00:00
|
|
|
nix.nixPath = [
|
|
|
|
"nixpkgs=${nixpkgs}"
|
|
|
|
"nixpkgs-unstable=${nixpkgs-unstable}"
|
|
|
|
"/nix/var/nix/profiles/per-user/root/channels"
|
|
|
|
];
|
2022-07-04 19:41:04 +00:00
|
|
|
# Binary Cache for Haskell.nix
|
2022-09-02 21:07:53 +00:00
|
|
|
nix.settings.trusted-public-keys = [
|
2023-09-11 09:05:18 +00:00
|
|
|
# "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
|
2022-07-04 19:41:04 +00:00
|
|
|
];
|
2022-09-02 21:07:53 +00:00
|
|
|
nix.settings.substituters = [
|
2023-09-11 09:05:18 +00:00
|
|
|
# "https://cache.iog.io"
|
2022-07-04 19:41:04 +00:00
|
|
|
];
|
|
|
|
};
|
2023-04-18 11:03:19 +00:00
|
|
|
nixpkgsAsRegistry = nixpkgsAsRegistry_ nixpkgs;
|
|
|
|
|
2023-09-26 20:31:25 +00:00
|
|
|
osuStable = { pkgs, ... }: {
|
|
|
|
nix.settings = {
|
|
|
|
substituters = [ "https://nix-gaming.cachix.org" ];
|
|
|
|
trusted-public-keys = [ "nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4=" ];
|
|
|
|
};
|
|
|
|
environment.systemPackages = [ inputs.nix-gaming.packages.${pkgs.hostPlatform.system}.osu-stable ];
|
|
|
|
};
|
|
|
|
|
2023-04-18 11:03:19 +00:00
|
|
|
# Common Nix modules
|
|
|
|
common-nix = stable: { ... }: {
|
|
|
|
imports = [
|
|
|
|
(nixpkgsAsRegistry_ stable)
|
|
|
|
./common.nix
|
|
|
|
sops-nix.nixosModules.sops
|
|
|
|
];
|
|
|
|
};
|
|
|
|
common-nixos = stable: { ... }: {
|
|
|
|
imports = [
|
2023-04-23 09:28:35 +00:00
|
|
|
./modules/my-tinc
|
|
|
|
./modules/common/linux
|
2023-04-18 11:03:19 +00:00
|
|
|
(common-nix stable)
|
|
|
|
inputs.secrets.nixosModules.common
|
|
|
|
];
|
|
|
|
};
|
2021-12-09 20:54:26 +00:00
|
|
|
|
2021-10-29 17:31:16 +00:00
|
|
|
in
|
|
|
|
{
|
2023-04-18 11:03:19 +00:00
|
|
|
overlays.default = lib.composeManyExtensions overlays;
|
|
|
|
|
2023-06-03 11:47:20 +00:00
|
|
|
packages.x86_64-linux.deploy-rs = deploy-rs.packages.x86_64-linux.default;
|
|
|
|
apps.x86_64-linux.deploy-rs = deploy-rs.apps.x86_64-linux.default;
|
|
|
|
|
2021-10-29 17:31:16 +00:00
|
|
|
# MacBook configuration: nix-darwin + home-manager
|
2022-07-04 19:41:04 +00:00
|
|
|
darwinConfigurations."nki-macbook" = darwin.lib.darwinSystem rec {
|
2021-10-29 17:31:16 +00:00
|
|
|
system = "aarch64-darwin";
|
|
|
|
modules = [
|
2023-04-18 11:03:19 +00:00
|
|
|
(common-nix nixpkgs-unstable)
|
2021-10-29 17:31:16 +00:00
|
|
|
./darwin/configuration.nix
|
2023-06-06 20:36:45 +00:00
|
|
|
inputs.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
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2021-10-28 22:15:24 +00:00
|
|
|
|
2021-10-29 17:31:16 +00:00
|
|
|
# Home configuration
|
2023-06-03 11:39:55 +00:00
|
|
|
nixosConfigurations."nki-home" = nixpkgs.lib.nixosSystem rec {
|
2021-10-29 17:31:16 +00:00
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
2023-06-03 11:39:55 +00:00
|
|
|
(common-nixos nixpkgs)
|
2021-10-29 17:31:16 +00:00
|
|
|
./nki-home/configuration.nix
|
2023-09-26 20:31:25 +00:00
|
|
|
osuStable
|
2023-06-06 20:36:45 +00:00
|
|
|
inputs.home-manager.nixosModules.home-manager
|
2021-10-29 17:31:16 +00:00
|
|
|
{
|
|
|
|
home-manager.useGlobalPkgs = true;
|
|
|
|
home-manager.useUserPackages = true;
|
2023-03-31 08:26:13 +00:00
|
|
|
home-manager.users.nki = { ... }: {
|
|
|
|
imports = [
|
|
|
|
./home/kagami-pc-home.nix
|
|
|
|
];
|
|
|
|
};
|
2021-10-29 17:31:16 +00:00
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2023-08-30 21:53:14 +00:00
|
|
|
# yoga g8 configuration
|
|
|
|
nixosConfigurations."nki-yoga-g8" = nixpkgs.lib.nixosSystem rec {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
|
|
|
(common-nixos nixpkgs)
|
|
|
|
inputs.lanzaboote.nixosModules.lanzaboote
|
|
|
|
({ ... }: {
|
|
|
|
# Sets up secure boot
|
|
|
|
boot.loader.systemd-boot.enable = lib.mkForce false;
|
|
|
|
boot.lanzaboote = {
|
|
|
|
enable = true;
|
|
|
|
pkiBundle = "/etc/secureboot";
|
|
|
|
};
|
|
|
|
})
|
|
|
|
./nki-yoga-g8/configuration.nix
|
|
|
|
home-manager.nixosModules.home-manager
|
|
|
|
{
|
|
|
|
home-manager.useGlobalPkgs = true;
|
|
|
|
home-manager.useUserPackages = true;
|
|
|
|
home-manager.users.nki = import ./home/nki-x1c1.nix;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2022-10-16 21:55:37 +00:00
|
|
|
# macbook nixos
|
2023-06-06 20:36:45 +00:00
|
|
|
nixosConfigurations."kagami-air-m1" = inputs.nixpkgs.lib.nixosSystem rec {
|
2022-10-16 21:55:37 +00:00
|
|
|
system = "aarch64-linux";
|
|
|
|
modules = [
|
2023-06-06 20:36:45 +00:00
|
|
|
(common-nixos inputs.nixpkgs)
|
2023-02-25 20:43:29 +00:00
|
|
|
inputs.nixos-m1.nixosModules.apple-silicon-support
|
2022-10-16 21:55:37 +00:00
|
|
|
./kagami-air-m1/configuration.nix
|
2023-06-06 20:36:45 +00:00
|
|
|
inputs.home-manager.nixosModules.home-manager
|
2022-10-16 21:55:37 +00:00
|
|
|
{
|
|
|
|
home-manager.useGlobalPkgs = true;
|
|
|
|
home-manager.useUserPackages = true;
|
|
|
|
home-manager.users.nki = import ./home/macbook-nixos.nix;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2021-10-31 19:06:44 +00:00
|
|
|
|
|
|
|
# DigitalOcean node
|
2022-12-05 09:59:59 +00:00
|
|
|
nixosConfigurations."nki-personal-do" = nixpkgs.lib.nixosSystem rec {
|
2021-10-31 19:06:44 +00:00
|
|
|
system = "x86_64-linux";
|
|
|
|
modules = [
|
2023-04-18 11:03:19 +00:00
|
|
|
(common-nixos nixpkgs)
|
2023-04-26 21:23:28 +00:00
|
|
|
inputs.arion.nixosModules.arion
|
2021-10-31 19:06:44 +00:00
|
|
|
./modules/my-tinc
|
2023-06-19 23:27:51 +00:00
|
|
|
inputs.youmubot.nixosModules.default
|
2021-10-31 19:06:44 +00:00
|
|
|
./nki-personal-do/configuration.nix
|
2023-04-19 12:23:10 +00:00
|
|
|
inputs.secrets.nixosModules.nki-personal-do
|
2021-10-31 19:06:44 +00:00
|
|
|
];
|
|
|
|
};
|
|
|
|
deploy.nodes."nki-personal-do" = {
|
2023-08-31 08:40:42 +00:00
|
|
|
hostname = "nki.personal";
|
2021-10-31 19:06:44 +00:00
|
|
|
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;
|
|
|
|
|
2022-05-31 16:45:33 +00:00
|
|
|
} // (inputs.flake-utils.lib.eachDefaultSystem (system: {
|
|
|
|
formatter = nixpkgs.legacyPackages.${system}.nixpkgs-fmt;
|
|
|
|
}));
|
2021-10-26 18:25:19 +00:00
|
|
|
}
|