nixos/flake.nix

181 lines
5.4 KiB
Nix
Raw Normal View History

2023-06-21 17:41:35 +01:00
{
description = "Evie's machine configurations";
nixConfig = {
extra-substituters = ["https://nix.xenia.me.uk"];
2024-04-17 18:04:43 +01:00
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";
};
2024-03-12 05:46:32 +00:00
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;
};
};
2023-06-21 17:41:35 +01:00
2024-01-30 14:21:50 +00:00
outputs = {
nixpkgs,
home-manager,
iosevka-custom,
base16,
tt-schemes,
2024-01-30 14:21:50 +00:00
...
}: let
defaultSpecialArgs = {system ? "x86_64-linux", ...}: {
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 iosevkaCustom;
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 ? "zsh",
...
}: [
home-manager.nixosModules.home-manager
./system/default.nix
./system/${hostName}.nix
./system/hardware-configuration/${hostName}.nix
({
config,
lib,
pkgs,
...
}: {
networking = {inherit hostName;};
nix.settings.trusted-users = [username];
services.greetd.settings.initial_session.user = username;
programs.${loginShell}.enable = true;
users.users.${username} = {
shell = pkgs.${loginShell};
group = "users";
isNormalUser = true;
description = "Evie Litherland-Smith";
extraGroups = ["networkmanager" "wheel" "video" "input" "uinput"];
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;
2024-07-03 08:02:31 +01:00
backupFileExtension = "backup";
users.${username} = {
imports = [
base16.homeManagerModule
{scheme = "${tt-schemes}/base16/one-light.yaml";}
./home/default.nix
./home/${hostName}.nix
];
home = {
inherit username;
homeDirectory = "/home/${username}";
stateVersion = "23.05";
};
programs.home-manager.enable = true;
nixpkgs.config.allowUnfree = true;
};
};
})
];
2024-01-30 14:21:50 +00:00
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 = {
2024-01-30 14:21:50 +00:00
## Server
Legion = let
system = "x86_64-linux";
username = "pixelifytica";
hostName = "Legion";
loginShell = "zsh";
in
nixpkgs.lib.nixosSystem {
specialArgs = defaultSpecialArgs {inherit system;};
modules = defaultModules {inherit system username hostName loginShell;};
};
2024-01-30 14:21:50 +00:00
## Personal
Northstar = let
system = "x86_64-linux";
username = "pixelifytica";
hostName = "Northstar";
loginShell = "zsh";
in
nixpkgs.lib.nixosSystem {
specialArgs = defaultSpecialArgs {inherit system;};
modules = defaultModules {inherit system username hostName loginShell;};
};
Vanguard = let
system = "x86_64-linux";
username = "pixelifytica";
hostName = "Vanguard";
loginShell = "zsh";
in
nixpkgs.lib.nixosSystem {
specialArgs = defaultSpecialArgs {inherit system;};
modules = defaultModules {inherit system username hostName loginShell;};
};
2024-01-30 14:21:50 +00:00
## Work
Tone = let
system = "x86_64-linux";
username = "elitherl";
hostName = "Tone";
loginShell = "zsh";
in
nixpkgs.lib.nixosSystem {
specialArgs = defaultSpecialArgs {inherit system;};
modules = defaultModules {inherit system username hostName loginShell;};
};
Scorch = let
system = "x86_64-linux";
username = "elitherl";
hostName = "Scorch";
loginShell = "zsh";
in
nixpkgs.lib.nixosSystem {
specialArgs = defaultSpecialArgs {inherit system;};
modules = defaultModules {inherit system username hostName loginShell;};
};
};
2024-01-30 14:21:50 +00:00
};
2023-06-21 17:41:35 +01:00
}