nixos/flake.nix

230 lines
6.9 KiB
Nix

{
description = "Evie's machine configurations";
nixConfig = {
extra-substituters = [ "https://nix.xenia.me.uk" ];
extra-trusted-public-keys = [ "nix.xenia.me.uk:tlgwOaG5KMLjQUk2YaErS8mAG69ZCr3PaHXZYi+Y5eI=" ];
};
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
home-manager = {
url = "github:nix-community/home-manager/release-24.05";
inputs.nixpkgs.follows = "nixpkgs";
};
plasma-manager = {
url = "github:nix-community/plasma-manager";
inputs = {
nixpkgs.follows = "nixpkgs";
home-manager.follows = "home-manager";
};
};
nix-index-database = {
url = "github:nix-community/nix-index-database";
inputs.nixpkgs.follows = "nixpkgs";
};
iosevka-custom.url = "git+https://git.xenia.me.uk/pixelifytica/iosevka.git";
base16.url = "github:SenchoPens/base16.nix";
tt-schemes = {
url = "github:tinted-theming/schemes";
flake = false;
};
};
outputs =
{
nixpkgs,
home-manager,
plasma-manager,
nix-index-database,
iosevka-custom,
base16,
tt-schemes,
...
}@inputs:
let
defaultSpecialArgs =
{
system ? "x86_64-linux",
...
}:
{
inherit inputs;
iosevkaCustom = {
packages = iosevka-custom.outputs.packages.${system};
names = iosevka-custom.outputs.names;
};
};
defaultExtraSpecialArgs =
{ system }:
let
iosevkaCustom = {
packages = iosevka-custom.outputs.packages.${system};
names = iosevka-custom.outputs.names;
};
in
{
inherit inputs iosevkaCustom;
inherit (plasma-manager.packages.${system}) rc2nix;
accentColourName = "base0E";
fonts = with iosevkaCustom; rec {
sizes = {
applications = 12;
desktop = 10;
popups = 14;
terminal = 12;
};
serif = sansSerif;
sansSerif = {
name = names.iosevka-custom-aile;
package = packages.iosevka-custom-aile;
};
monospace = {
name = names.iosevka-custom-nerdfont;
package = packages.iosevka-custom-nerdfont;
};
};
};
defaultModules =
{
system ? "x86_64-linux",
username ? "pixelifytica",
hostName ? "Atlas",
loginShell ? "bash",
...
}:
[
home-manager.nixosModules.home-manager
./system/default.nix
./system/${hostName}.nix
./system/hardware-configuration/${hostName}.nix
(
{
config,
lib,
pkgs,
...
}:
{
networking = {
inherit hostName;
};
nix = {
package = pkgs.nixVersions.latest;
settings.trusted-users = [ username ];
};
services.greetd.settings.initial_session.user = username;
programs.${loginShell} = lib.mkIf (loginShell != "bash") { enable = true; };
users.users.${username} = {
shell = pkgs.${loginShell};
group = "users";
isNormalUser = true;
description = "Evie Litherland-Smith";
extraGroups = [
"networkmanager"
"wheel"
"video"
"input"
"uinput"
"dialout"
];
initialHashedPassword = "$y$j9T$tHIPQt09Kf3KH2eIRze3g/$2mwSlcq27DTGvHNPJ5EP9/1CfL3bXP0F6oS/Vuffmn3";
openssh = {
inherit (config.users.users.root.openssh) authorizedKeys;
};
};
home-manager = {
extraSpecialArgs = defaultExtraSpecialArgs { inherit system; };
useGlobalPkgs = true;
useUserPackages = true;
backupFileExtension = "backup";
users.${username} = {
imports = [
base16.homeManagerModule
nix-index-database.hmModules.nix-index
{ scheme = "${tt-schemes}/base16/one-light.yaml"; }
./home/${hostName}.nix
];
home = {
inherit username;
homeDirectory = "/home/${username}";
stateVersion = "23.05";
};
programs.home-manager.enable = true;
nixpkgs.config.allowUnfree = true;
};
};
}
)
];
in
{
devShells.x86_64-linux.default =
let
pkgs = import nixpkgs { system = "x86_64-linux"; };
in
pkgs.mkShellNoCC {
packages = with pkgs; [
nil
pre-commit
];
shellHook = "pre-commit install --install-hooks";
};
nixosConfigurations = {
## Server
Legion =
let
system = "x86_64-linux";
username = "pixelifytica";
hostName = "Legion";
in
nixpkgs.lib.nixosSystem {
specialArgs = defaultSpecialArgs { inherit system; };
modules = defaultModules { inherit system username hostName; };
};
## Personal
Vanguard =
let
system = "x86_64-linux";
username = "pixelifytica";
hostName = "Vanguard";
in
nixpkgs.lib.nixosSystem {
specialArgs = defaultSpecialArgs { inherit system; };
modules = defaultModules { inherit system username hostName; };
};
Northstar =
let
system = "x86_64-linux";
username = "pixelifytica";
hostName = "Northstar";
in
nixpkgs.lib.nixosSystem {
specialArgs = defaultSpecialArgs { inherit system; };
modules = defaultModules { inherit system username hostName; };
};
## Work
Tone =
let
system = "x86_64-linux";
username = "elitherl";
hostName = "Tone";
in
nixpkgs.lib.nixosSystem {
specialArgs = defaultSpecialArgs { inherit system; };
modules = defaultModules { inherit system username hostName; };
};
Ronin =
let
system = "x86_64-linux";
username = "elitherl";
hostName = "Ronin";
in
nixpkgs.lib.nixosSystem {
specialArgs = defaultSpecialArgs { inherit system; };
modules = defaultModules { inherit system username hostName; };
};
};
};
}