meta: Remove variables from containers

Modules solve the variable problem in a nicer way.
This commit is contained in:
Donovan Glover 2023-06-22 11:43:19 -04:00
parent 7316153e37
commit 0aaba9a591
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
7 changed files with 21 additions and 48 deletions

View File

@ -1,7 +1,5 @@
{ home-manager, ... }: { home-manager, ... }:
let
VARIABLES = import ../src/variables.nix;
in
{ {
containers.dev = { containers.dev = {
privateNetwork = true; privateNetwork = true;
@ -11,7 +9,7 @@ in
bindMounts = { bindMounts = {
"/mnt" = { "/mnt" = {
hostPath = "/home/${VARIABLES.username}/containers/dev"; hostPath = "/home/user/containers/dev";
isReadOnly = false; isReadOnly = false;
}; };
}; };
@ -40,7 +38,7 @@ in
}; };
home-manager.users.user = { pkgs, ... }: { home-manager.users.user = { pkgs, ... }: {
home.stateVersion = VARIABLES.stateVersion; home.stateVersion = "22.11";
}; };
environment = { environment = {
@ -49,7 +47,7 @@ in
}; };
environment.systemPackages = with pkgs; [ kitty ]; environment.systemPackages = with pkgs; [ kitty ];
system.stateVersion = VARIABLES.stateVersion; system.stateVersion = "22.11";
}; };
}; };
} }

View File

@ -1,7 +1,5 @@
{ home-manager, stylix, ... }: { home-manager, stylix, ... }:
let
VARIABLES = import ../src/variables.nix;
in
{ {
containers.gui = { containers.gui = {
privateNetwork = true; privateNetwork = true;
@ -9,7 +7,7 @@ in
bindMounts = { bindMounts = {
"/mnt" = { "/mnt" = {
hostPath = "/home/${VARIABLES.username}/containers/gui"; hostPath = "/home/user/containers/gui";
isReadOnly = false; isReadOnly = false;
}; };
@ -54,12 +52,9 @@ in
}; };
}; };
#home-manager.sharedModules = [{
#}];
home-manager.users.user = { pkgs, ... }: { home-manager.users.user = { pkgs, ... }: {
home.packages = [ pkgs.atool pkgs.httpie ]; home.packages = [ pkgs.atool pkgs.httpie ];
home.stateVersion = VARIABLES.stateVersion; home.stateVersion = "22.11";
}; };
environment = { environment = {
@ -67,8 +62,7 @@ in
defaultPackages = [ ]; defaultPackages = [ ];
}; };
# environment.systemPackages = with pkgs; [ kitty ]; system.stateVersion = "22.11";
system.stateVersion = VARIABLES.stateVersion;
}; };
}; };
} }

View File

@ -1,12 +1,11 @@
{ lib, ... }: { lib, ... }: {
let VARIABLES = import ../src/variables.nix; in {
containers.obsidian = { containers.obsidian = {
privateNetwork = true; privateNetwork = true;
ephemeral = true; ephemeral = true;
bindMounts = { bindMounts = {
"/mnt" = { "/mnt" = {
hostPath = "/home/${VARIABLES.username}/containers/obsidian"; hostPath = "/home/user/containers/obsidian";
isReadOnly = false; isReadOnly = false;
}; };
@ -23,9 +22,6 @@ let VARIABLES = import ../src/variables.nix; in {
}; };
config = { pkgs, ... }: { config = { pkgs, ... }: {
i18n.defaultLocale = VARIABLES.defaultLocale;
i18n.supportedLocales = VARIABLES.supportedLocales;
users = { users = {
mutableUsers = false; mutableUsers = false;
allowNoPasswordLogin = true; allowNoPasswordLogin = true;
@ -67,7 +63,7 @@ let VARIABLES = import ../src/variables.nix; in {
"obsidian" "obsidian"
]; ];
system.stateVersion = VARIABLES.stateVersion; system.stateVersion = "22.11";
}; };
}; };
} }

View File

@ -1,10 +1,10 @@
let VARIABLES = import ../src/variables.nix; in { {
containers.rar = { containers.rar = {
privateNetwork = true; privateNetwork = true;
bindMounts = { bindMounts = {
"/home/user" = { "/home/user" = {
hostPath = "/home/${VARIABLES.username}/containers/rar"; hostPath = "/home/user/containers/rar";
isReadOnly = false; isReadOnly = false;
}; };
}; };
@ -49,7 +49,7 @@ let VARIABLES = import ../src/variables.nix; in {
"unrar" "unrar"
]; ];
system.stateVersion = VARIABLES.stateVersion; system.stateVersion = "22.11";
}; };
}; };
} }

View File

@ -1,15 +1,11 @@
{ home-manager, stylix, ... }: { home-manager, stylix, ... }: {
let
VARIABLES = import ../src/variables.nix;
in
{
containers.srb2 = { containers.srb2 = {
privateNetwork = true; privateNetwork = true;
ephemeral = true; ephemeral = true;
bindMounts = { bindMounts = {
"/home/user/.srb2" = { "/home/user/.srb2" = {
hostPath = "/home/${VARIABLES.username}/containers/srb2"; hostPath = "/home/user/containers/srb2";
isReadOnly = false; isReadOnly = false;
}; };
@ -62,7 +58,7 @@ in
}; };
home-manager.users.user = { ... }: { home-manager.users.user = { ... }: {
home.stateVersion = VARIABLES.stateVersion; home.stateVersion = "22.11";
}; };
environment = { environment = {
@ -70,7 +66,7 @@ in
defaultPackages = [ ]; defaultPackages = [ ];
}; };
system.stateVersion = VARIABLES.stateVersion; system.stateVersion = "22.11";
}; };
}; };
} }

View File

@ -1,11 +1,10 @@
let VARIABLES = import ../src/variables.nix; in {
containers.wine = { containers.wine = {
privateNetwork = true; privateNetwork = true;
ephemeral = true; ephemeral = true;
bindMounts = { bindMounts = {
"/home/user" = { "/mnt" = {
hostPath = "/home/${VARIABLES.username}/containers/wine"; hostPath = "/home/user/containers/wine";
isReadOnly = false; isReadOnly = false;
}; };
@ -44,8 +43,6 @@ let VARIABLES = import ../src/variables.nix; in {
starship.enable = true; starship.enable = true;
}; };
i18n.defaultLocale = VARIABLES.defaultLocale;
i18n.supportedLocales = VARIABLES.supportedLocales;
users = { users = {
defaultUserShell = pkgs.fish; defaultUserShell = pkgs.fish;
@ -92,7 +89,7 @@ let VARIABLES = import ../src/variables.nix; in {
driSupport32Bit = true; driSupport32Bit = true;
}; };
system.stateVersion = VARIABLES.stateVersion; system.stateVersion = "22.11";
}; };
}; };
} }

View File

@ -1,8 +0,0 @@
{
hostname = "nixos";
system = "x86_64-linux";
hostHardwareConfiguration = ../hardware/laptop.nix;
stateVersion = "22.11";
username = "user";
defaultBrowser = "librewolf";
}