Compare commits
2 Commits
6441652b8c
...
150d2f2e07
Author | SHA1 | Date | |
---|---|---|---|
|
150d2f2e07 | ||
|
b644c87517 |
57
flake.nix
57
flake.nix
@ -30,61 +30,22 @@
|
||||
};
|
||||
|
||||
outputs = inputs:
|
||||
|
||||
let gen = import ./generator.nix { inherit inputs; };
|
||||
in {
|
||||
devShells = import ./shells { inherit inputs; };
|
||||
|
||||
nixosConfigurations = {
|
||||
valinor = gen.generate {
|
||||
type = "nixos";
|
||||
system = "x86_64-linux";
|
||||
host = "valinor";
|
||||
};
|
||||
iriy = gen.generate {
|
||||
type = "nixos";
|
||||
system = "x86_64-linux";
|
||||
host = "iriy";
|
||||
};
|
||||
efir = gen.generate {
|
||||
type = "nixos";
|
||||
system = "x86_64-linux";
|
||||
host = "efir";
|
||||
};
|
||||
avalon = gen.generate {
|
||||
type = "nixos";
|
||||
system = "x86_64-linux";
|
||||
host = "avalon";
|
||||
};
|
||||
ci = gen.generate {
|
||||
type = "nixos";
|
||||
system = "x86_64-linux";
|
||||
host = "ci";
|
||||
};
|
||||
sandbox = gen.generate {
|
||||
type = "nixos";
|
||||
system = "x86_64-linux";
|
||||
host = "sandbox";
|
||||
};
|
||||
};
|
||||
darwinConfigurations = {
|
||||
asgard = gen.generate {
|
||||
type = "macos";
|
||||
system = "x86_64-darwin";
|
||||
host = "asgard";
|
||||
};
|
||||
valinor = gen.generate { host = "valinor"; };
|
||||
iriy = gen.generate { host = "iriy"; };
|
||||
efir = gen.generate { host = "efir"; };
|
||||
avalon = gen.generate { host = "avalon"; };
|
||||
ci = gen.generate { host = "ci"; };
|
||||
sandbox = gen.generate { host = "sandbox"; };
|
||||
};
|
||||
darwinConfigurations = { asgard = gen.generate { host = "asgard"; }; };
|
||||
homeConfigurations = {
|
||||
yomi = gen.generate {
|
||||
type = "home";
|
||||
system = "arm-64";
|
||||
host = "example";
|
||||
};
|
||||
example = gen.generate {
|
||||
type = "home";
|
||||
system = "-"; # supports any
|
||||
host = "example";
|
||||
};
|
||||
yomi = gen.generate { host = "example"; };
|
||||
example = gen.generate { host = "example"; };
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
{ inputs, ... }: {
|
||||
generate = { type, system, host }:
|
||||
generate = { host }:
|
||||
let
|
||||
nameValuePair = name: value: { inherit name value; };
|
||||
syscfg = import ./systems/${host}/cfg.nix;
|
||||
nameValuePair = name: value: { inherit name value; };
|
||||
in ({
|
||||
"nixos" = inputs.nixpkgs.lib.nixosSystem {
|
||||
system = system;
|
||||
system = syscfg.syscfg.system;
|
||||
modules = [
|
||||
./modules/shared/syscfg
|
||||
./modules/shared/sops
|
||||
@ -33,29 +33,33 @@
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
"macos" = inputs.darwin.lib.darwinSystem {
|
||||
system = system;
|
||||
system = syscfg.system;
|
||||
modules = [
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
./modules/shared/syscfg
|
||||
./modules/shared/sops
|
||||
syscfg
|
||||
./systems/${host}
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
inputs.home-manager.darwinModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.extraSpecialArgs = { inherit inputs; };
|
||||
home-manager.users.sora = {
|
||||
imports = [
|
||||
inputs.nix-colors.homeManagerModule
|
||||
inputs.hyprland.homeManagerModules
|
||||
./systems/${host}/home.nix
|
||||
];
|
||||
};
|
||||
home-manager.users = builtins.listToAttrs (map (userConfig:
|
||||
nameValuePair userConfig.username {
|
||||
imports = [
|
||||
inputs.nix-colors.homeManagerModule
|
||||
inputs.hyprland.homeManagerModules
|
||||
];
|
||||
}) syscfg.syscfg.users);
|
||||
}
|
||||
];
|
||||
};
|
||||
"home" = inputs.home-manager.lib.homeManagerConfiguration {
|
||||
modules = [ ./modules/home ./systems/${host}/home.nix ];
|
||||
modules = [ ./modules/home ];
|
||||
};
|
||||
_ = throw "Unsupported system";
|
||||
}.${type});
|
||||
}.${syscfg.syscfg.type});
|
||||
}
|
||||
|
@ -1,67 +1,68 @@
|
||||
{ config, lib, pkgs, ... }: {
|
||||
config = lib.mkMerge[
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf (config.syscfg.make.gui) {
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
# wlr.enable = true;
|
||||
extraPortals = with pkgs; [
|
||||
xdg-desktop-portal-hyprland
|
||||
xdg-desktop-portal-gtk
|
||||
];
|
||||
config.common.default = [ "hyprland" "gtk" ];
|
||||
};
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
# wlr.enable = true;
|
||||
extraPortals = with pkgs; [
|
||||
xdg-desktop-portal-hyprland
|
||||
xdg-desktop-portal-gtk
|
||||
];
|
||||
config.common.default = [ "hyprland" "gtk" ];
|
||||
};
|
||||
|
||||
environment.sessionVariables = rec {
|
||||
GBM_BACKEND = "amd-drm";
|
||||
__GL_GSYNC_ALLOWED = "0";
|
||||
__GL_VRR_ALLOWED = "1";
|
||||
WLR_DRM_NO_ATOMIC = "1";
|
||||
__GLX_VENDOR_LIBRARY_NAME = "amd";
|
||||
_JAVA_AWT_WM_NONREPARENTING = "1";
|
||||
QT_QPA_PLATFORM = "wayland";
|
||||
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
|
||||
GDK_BACKEND = "wayland";
|
||||
WLR_NO_HARDWARE_CURSORS = "1";
|
||||
MOZ_ENABLE_WAYLAND = "1";
|
||||
WLR_BACKEND = "vulkan";
|
||||
WLR_RENDERER = "vulkan";
|
||||
XCURSOR_SIZE = "24";
|
||||
NIXOS_OZONE_WL = "1";
|
||||
};
|
||||
})
|
||||
({
|
||||
environment.sessionVariables = rec {
|
||||
GBM_BACKEND = "amd-drm";
|
||||
__GL_GSYNC_ALLOWED = "0";
|
||||
__GL_VRR_ALLOWED = "1";
|
||||
WLR_DRM_NO_ATOMIC = "1";
|
||||
__GLX_VENDOR_LIBRARY_NAME = "amd";
|
||||
_JAVA_AWT_WM_NONREPARENTING = "1";
|
||||
QT_QPA_PLATFORM = "wayland";
|
||||
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
|
||||
GDK_BACKEND = "wayland";
|
||||
WLR_NO_HARDWARE_CURSORS = "1";
|
||||
MOZ_ENABLE_WAYLAND = "1";
|
||||
WLR_BACKEND = "vulkan";
|
||||
WLR_RENDERER = "vulkan";
|
||||
XCURSOR_SIZE = "24";
|
||||
NIXOS_OZONE_WL = "1";
|
||||
};
|
||||
})
|
||||
({
|
||||
|
||||
environment.sessionVariables = rec {
|
||||
PATH = [ "$HOME/.local/bin/:$PATH" ];
|
||||
XDG_CACHE_HOME = "$HOME/.cache";
|
||||
XDG_CONFIG_HOME = "$HOME/.config";
|
||||
XDG_DATA_HOME = "$HOME/.local/share";
|
||||
XDG_STATE_HOME = "$HOME/.local/state";
|
||||
XDG_BIN_HOME = "$HOME/.local/bin";
|
||||
XDG_DESKTOP_DIR = "$HOME/desktop";
|
||||
XDG_DOCUMENTS_DIR = "$HOME/files";
|
||||
XDG_DOWNLOAD_DIR = "$HOME/download";
|
||||
XDG_MUSIC_DIR = "$HOME/media/music";
|
||||
XDG_PICTURES_DIR = "$HOME/media/photo";
|
||||
XDG_PUBLICSHARE_DIR = "$HOME/pub";
|
||||
XDG_TEMPLATES_DIR = "$HOME/media/templates";
|
||||
XDG_VIDEOS_DIR = "$HOME/media/video";
|
||||
};
|
||||
environment.sessionVariables = rec {
|
||||
PATH = [ "$HOME/.local/bin/:$PATH" ];
|
||||
XDG_CACHE_HOME = "$HOME/.cache";
|
||||
XDG_CONFIG_HOME = "$HOME/.config";
|
||||
XDG_DATA_HOME = "$HOME/.local/share";
|
||||
XDG_STATE_HOME = "$HOME/.local/state";
|
||||
XDG_BIN_HOME = "$HOME/.local/bin";
|
||||
XDG_DESKTOP_DIR = "$HOME/desktop";
|
||||
XDG_DOCUMENTS_DIR = "$HOME/files";
|
||||
XDG_DOWNLOAD_DIR = "$HOME/download";
|
||||
XDG_MUSIC_DIR = "$HOME/media/music";
|
||||
XDG_PICTURES_DIR = "$HOME/media/photo";
|
||||
XDG_PUBLICSHARE_DIR = "$HOME/pub";
|
||||
XDG_TEMPLATES_DIR = "$HOME/media/templates";
|
||||
XDG_VIDEOS_DIR = "$HOME/media/video";
|
||||
};
|
||||
|
||||
environment.etc."xdg/user-dirs.defaults".text = ''
|
||||
XDG_CACHE_HOME="$HOME/.cache"
|
||||
XDG_CONFIG_HOME="$HOME/.config"
|
||||
XDG_DATA_HOME="$HOME/.local/share"
|
||||
XDG_STATE_HOME="$HOME/.local/state"
|
||||
XDG_BIN_HOME="$HOME/.local/bin"
|
||||
XDG_DESKTOP_DIR="$HOME/desktop"
|
||||
XDG_DOCUMENTS_DIR="$HOME/files"
|
||||
XDG_DOWNLOAD_DIR="$HOME/download"
|
||||
XDG_MUSIC_DIR="$HOME/media/music"
|
||||
XDG_PICTURES_DIR="$HOME/media/photo"
|
||||
XDG_PUBLICSHARE_DIR="$HOME/pub"
|
||||
XDG_TEMPLATES_DIR="$HOME/media/templates"
|
||||
XDG_VIDEOS_DIR="$HOME/media/video"
|
||||
'';
|
||||
})];
|
||||
environment.etc."xdg/user-dirs.defaults".text = ''
|
||||
XDG_CACHE_HOME="$HOME/.cache"
|
||||
XDG_CONFIG_HOME="$HOME/.config"
|
||||
XDG_DATA_HOME="$HOME/.local/share"
|
||||
XDG_STATE_HOME="$HOME/.local/state"
|
||||
XDG_BIN_HOME="$HOME/.local/bin"
|
||||
XDG_DESKTOP_DIR="$HOME/desktop"
|
||||
XDG_DOCUMENTS_DIR="$HOME/files"
|
||||
XDG_DOWNLOAD_DIR="$HOME/download"
|
||||
XDG_MUSIC_DIR="$HOME/media/music"
|
||||
XDG_PICTURES_DIR="$HOME/media/photo"
|
||||
XDG_PUBLICSHARE_DIR="$HOME/pub"
|
||||
XDG_TEMPLATES_DIR="$HOME/media/templates"
|
||||
XDG_VIDEOS_DIR="$HOME/media/video"
|
||||
'';
|
||||
})
|
||||
];
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
{ ... }:
|
||||
{
|
||||
virtualisation.arion.projects.
|
||||
# virtualisation.arion.projects.
|
||||
}
|
||||
|
@ -98,6 +98,14 @@ in with lib; {
|
||||
options.usercfg = userOpt;
|
||||
options.syscfg = {
|
||||
hostname = mkOption { type = types.str; };
|
||||
type = mkOption {
|
||||
type = types.enum [ "nixos" "macos" "home" ];
|
||||
default = "nixos";
|
||||
};
|
||||
system = mkOption {
|
||||
type = types.enum [ "x86_64-linux" "x86_64-darwin" "-" ];
|
||||
default = "x86_64-linux";
|
||||
};
|
||||
defaultUser = mkOption { type = types.str; };
|
||||
make = makeOpt;
|
||||
net = netOpt;
|
||||
|
8
systems/asguard/cfg.nix
Normal file
8
systems/asguard/cfg.nix
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
syscfg = {
|
||||
hostname = "asguard";
|
||||
defaultUser = "sora";
|
||||
type = "macos";
|
||||
system = "x86_64-darwin";
|
||||
};
|
||||
}
|
@ -1,6 +1,8 @@
|
||||
{
|
||||
syscfg = {
|
||||
hostname = "avalon";
|
||||
system = "x86_64-linux";
|
||||
type = "nixos";
|
||||
defaultUser = "sora";
|
||||
users = [
|
||||
{
|
||||
@ -36,7 +38,6 @@
|
||||
enable = true;
|
||||
ip4 = "10.10.1.2/32";
|
||||
ip6 = "fd10:10:10::2/128";
|
||||
pk = config.sops.secrets.avalon_wg_priv.path;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
@ -1,6 +1,8 @@
|
||||
{
|
||||
syscfg = {
|
||||
hostname = "ci";
|
||||
type = "nixos";
|
||||
system = "x86_64-linux";
|
||||
defaultUser = "ci";
|
||||
users = [{
|
||||
username = "ci";
|
||||
|
@ -1,6 +1,8 @@
|
||||
{
|
||||
syscfg = {
|
||||
hostname = "iriy";
|
||||
type = "nixos";
|
||||
system = "x86_64-linux";
|
||||
defaultUser = "sora";
|
||||
users = [{
|
||||
username = "sora";
|
||||
|
@ -1,6 +1,8 @@
|
||||
{
|
||||
syscfg = {
|
||||
hostname = "sandbox";
|
||||
type = "nixos";
|
||||
system = "x86_64-linux";
|
||||
defaultUser = "sora";
|
||||
users = [{
|
||||
username = "sora";
|
||||
|
@ -1,6 +1,8 @@
|
||||
{
|
||||
syscfg = {
|
||||
hostname = "valinor";
|
||||
type = "nixos";
|
||||
system = "x86_64-linux";
|
||||
defaultUser = "sora";
|
||||
users = [{
|
||||
username = "sora";
|
||||
|
Loading…
x
Reference in New Issue
Block a user