nixos-config/flake.nix
Charlotte 🦝 Delenk 30e2515aee
Some checks reported errors
Hydra packages.x86_64-linux.package-updater Hydra build #25160 of nixos-config:pr618:packages.x86_64-linux.package-updater
Hydra packages.x86_64-linux.art-lotte-bgs-nsfw Hydra build #25158 of nixos-config:pr618:packages.x86_64-linux.art-lotte-bgs-nsfw
Hydra packages.riscv64-linux.art-lotte-bgs-nsfw Hydra build #25154 of nixos-config:pr618:packages.riscv64-linux.art-lotte-bgs-nsfw
Hydra packages.x86_64-linux.art-lotte-bgs-sfw Hydra build #25159 of nixos-config:pr618:packages.x86_64-linux.art-lotte-bgs-sfw
Hydra packages.aarch64-linux.art-lotte-bgs-nsfw Hydra build #25150 of nixos-config:pr618:packages.aarch64-linux.art-lotte-bgs-nsfw
Hydra packages.aarch64-linux.art-lotte-bgs-sfw Hydra build #25151 of nixos-config:pr618:packages.aarch64-linux.art-lotte-bgs-sfw
Hydra devShells.x86_64-linux.default Hydra build #25140 of nixos-config:pr618:devShells.x86_64-linux.default
Hydra packages.aarch64-linux.art-lotte Hydra build #25149 of nixos-config:pr618:packages.aarch64-linux.art-lotte
Hydra packages.riscv64-linux.art-lotte-bgs-sfw Hydra build #25155 of nixos-config:pr618:packages.riscv64-linux.art-lotte-bgs-sfw
Hydra nixosConfigurations.container-default-aarch64-linux Hydra build #25141 of nixos-config:pr618:nixosConfigurations.container-default-aarch64-linux
Hydra packages.x86_64-linux.art-lotte Hydra build #25157 of nixos-config:pr618:packages.x86_64-linux.art-lotte
Hydra packages.riscv64-linux.art-lotte Hydra build #25153 of nixos-config:pr618:packages.riscv64-linux.art-lotte
Hydra packages.aarch64-linux.package-updater Hydra build #25152 of nixos-config:pr618:packages.aarch64-linux.package-updater
Hydra nixosConfigurations.container-default-x86_64-linux Hydra build #25143 of nixos-config:pr618:nixosConfigurations.container-default-x86_64-linux
Hydra nixosConfigurations.thinkrac Hydra build #25148 of nixos-config:pr618:nixosConfigurations.thinkrac
Hydra nixosConfigurations.rainbow-resort Hydra build #25147 of nixos-config:pr618:nixosConfigurations.rainbow-resort
Hydra nixosConfigurations.pc-installer Hydra build #25146 of nixos-config:pr618:nixosConfigurations.pc-installer
Hydra checks.x86_64-linux.containers-default Hydra build #25139 of nixos-config:pr618:checks.x86_64-linux.containers-default
Hydra nixosConfigurations.not522-installer Hydra build #25145 of nixos-config:pr618:nixosConfigurations.not522-installer
Hydra nixosConfigurations.not522 Hydra build #25144 of nixos-config:pr618:nixosConfigurations.not522
Hydra nixosConfigurations.container-default-riscv64-linux Hydra build #25142 of nixos-config:pr618:nixosConfigurations.container-default-riscv64-linux
Hydra packages.riscv64-linux.package-updater Hydra build #25156 of nixos-config:pr618:packages.riscv64-linux.package-updater
add background slideshow
2024-11-10 22:20:25 +01:00

266 lines
7.2 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
description = "Lottes nix configuration";
inputs = {
disko = {
url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
flake-utils = {
url = "github:numtide/flake-utils";
inputs.systems.follows = "systems";
};
flakey-profile = {
url = "github:lf-/flakey-profile";
};
gitignore = {
url = "github:hercules-ci/gitignore.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
impermanence = {
url = "github:nix-community/impermanence";
};
lix = {
url = "git+https://git.lix.systems/lix-project/lix";
inputs.flake-compat.follows = "flake-compat";
inputs.nix2container.follows = "nix2container";
inputs.nixpkgs.follows = "nixpkgs";
inputs.pre-commit-hooks.follows = "pre-commit-hooks";
};
lix-module = {
url = "git+https://git.lix.systems/lix-project/nixos-module";
inputs.flake-utils.follows = "flake-utils";
inputs.flakey-profile.follows = "flakey-profile";
inputs.lix.follows = "lix";
inputs.nixpkgs.follows = "nixpkgs";
};
nix2container = {
url = "github:nlewo/nix2container";
inputs.flake-utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware.url = "github:NixOS/nixos-hardware";
nixpkgs.url = "github:nixos/nixpkgs";
nur.url = "github:nix-community/NUR";
plasma-manager = {
url = "github:nix-community/plasma-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
pre-commit-hooks = {
url = "github:cachix/git-hooks.nix";
inputs.flake-compat.follows = "flake-compat";
inputs.gitignore.follows = "gitignore";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs-stable.follows = "nixpkgs";
};
riscv-overlay = {
url = "github:DarkKirb/riscv-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs-stable.follows = "nixpkgs";
};
systems.url = "github:nix-systems/default";
vscode-server = {
url = "github:nix-community/nixos-vscode-server";
inputs.flake-utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
...
}@inputs':
let
inputs = inputs' // {
nixos-config = self;
inherit inputs;
inTester = false;
pureInputs = inputs';
};
pkgsFor =
system:
let
inputs' = inputs // {
inherit system;
inputs = inputs';
};
in
import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays =
[
(
_: _:
inputs'
// {
inputs = inputs';
}
)
self.overlays.default
]
++ (
if system == "riscv64-linux" then
[
inputs.riscv-overlay.overlays.default
]
else
[ ]
);
};
in
{
checks.x86_64-linux = nixpkgs.lib.listToAttrs (
map (testName: {
name = testName;
value = (pkgsFor "x86_64-linux").callPackage ./tests/${testName}.nix { };
}) [ "containers-default" ]
);
nixosModules = {
containers = import ./modules/containers/default.nix;
default = import ./modules/default.nix;
};
nixosContainers =
with nixpkgs.lib;
let
containerNames = [
"default"
];
containerArches = [
"x86_64-linux"
"aarch64-linux"
"riscv64-linux"
];
containers = listToAttrs (
flatten (
map (
system:
let
pkgs = pkgsFor system;
in
map (container: {
name = "container-${container}-${system}";
value = pkgs.callPackage ./containers/${container}-configuration.nix { };
}) containerNames
) containerArches
)
);
in
containers;
nixosConfigurations =
with nixpkgs.lib;
let
mkSystem =
args:
let
inputs' = inputs // {
inherit (args) system;
};
in
nixosSystem (
args
// {
specialArgs = args.specialArgs or { } // inputs';
}
);
systems' = {
not522 = {
config = ./machine/not522;
system = "riscv64-linux";
};
not522-installer = {
config = ./machine/not522/installer;
system = "riscv64-linux";
};
pc-installer = {
config = ./machine/pc-installer;
system = "x86_64-linux";
};
rainbow-resort = {
config = ./machine/rainbow-resort;
system = "x86_64-linux";
};
thinkrac = {
config = ./machine/thinkrac;
system = "x86_64-linux";
};
};
containers = mapAttrs (
_: container:
mkSystem {
inherit (container) system;
modules = [
container.config
];
}
) self.nixosContainers;
systems = mapAttrs (
_: system:
mkSystem {
inherit (system) system;
modules = [
system.config
];
}
) systems';
in
containers // systems;
hydraJobs = {
inherit (self) checks devShells packages;
nixosConfigurations = nixpkgs.lib.mapAttrs (
_: v: v.config.system.build.toplevel
) self.nixosConfigurations;
};
devShells.x86_64-linux.default =
with pkgsFor "x86_64-linux";
mkShell {
nativeBuildInputs = with pkgs; [
age
sops
ssh-to-age
nixfmt-rfc-style
nix-prefetch
nix-prefetch-git
];
};
formatter.x86_64-linux = (pkgsFor "x86_64-linux").nixfmt-rfc-style;
overlays.default = import ./packages;
packages = nixpkgs.lib.listToAttrs (
map
(name: {
inherit name;
value =
let
pkgs = pkgsFor name;
in
{
inherit (pkgs)
art-lotte
art-lotte-bgs-nsfw
art-lotte-bgs-sfw
package-updater
;
};
})
[
"x86_64-linux"
"riscv64-linux"
"aarch64-linux"
]
);
};
}