meta: Migrate to config.variables

This commit is contained in:
Donovan Glover 2023-06-22 10:42:23 -04:00
parent 2ea920c0c0
commit 2f056d1e72
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
11 changed files with 29 additions and 36 deletions

View File

@ -1,6 +1,6 @@
{ pkgs, ... }: { pkgs, config, ... }:
let VARIABLES = import ../src/variables.nix; in { {
home.packages = with pkgs; [ tig ]; home.packages = with pkgs; [ tig ];
xdg.configFile."tig/config".text = '' xdg.configFile."tig/config".text = ''
@ -22,7 +22,7 @@ let VARIABLES = import ../src/variables.nix; in {
quotePath = false; quotePath = false;
}; };
web.browser = VARIABLES.defaultBrowser; web.browser = config.variables.defaultBrowser;
push.default = "simple"; push.default = "simple";
branch.autosetuprebase = "always"; branch.autosetuprebase = "always";
init.defaultBranch = "master"; init.defaultBranch = "master";

View File

@ -1,9 +1,9 @@
{ pkgs, ... }: { pkgs, config, ... }:
let VARIABLES = import ../src/variables.nix; in { {
xdg.configFile."hypr/hyprland.conf".text = /* bash */ '' xdg.configFile."hypr/hyprland.conf".text = /* bash */ ''
env=XCURSOR_SIZE,24 env=XCURSOR_SIZE,24
env=BROWSER,${VARIABLES.defaultBrowser} env=BROWSER,${config.variables.defaultBrowser}
env=GTK_IM_MODULE,fcitx env=GTK_IM_MODULE,fcitx
env=QT_IM_MODULE,fcitx env=QT_IM_MODULE,fcitx
env=XMODIFIERS,@im=fcitx env=XMODIFIERS,@im=fcitx

View File

@ -1,4 +1,4 @@
let VARIABLES = import ../src/variables.nix; in { { config, ... }: {
programs.kitty = { programs.kitty = {
enable = true; enable = true;
@ -7,7 +7,7 @@ let VARIABLES = import ../src/variables.nix; in {
close_on_child_death = true; close_on_child_death = true;
cursor_blink_interval = 0; cursor_blink_interval = 0;
open_url_with = VARIABLES.defaultBrowser; open_url_with = config.variables.defaultBrowser;
wayland_titlebar_color = "background"; wayland_titlebar_color = "background";
allow_remote_control = true; allow_remote_control = true;

View File

@ -1,4 +1,4 @@
let VARIABLES = import ../src/variables.nix; in { { config, ... }: {
xdg.mimeApps = { xdg.mimeApps = {
enable = true; enable = true;
@ -7,8 +7,8 @@ let VARIABLES = import ../src/variables.nix; in {
"image/jpeg" = "feh.desktop"; "image/jpeg" = "feh.desktop";
"image/gif" = "org.qutebrowser.qutebrowser.desktop"; "image/gif" = "org.qutebrowser.qutebrowser.desktop";
"application/x-wine-extension-osz" = "osu-stable.desktop"; "application/x-wine-extension-osz" = "osu-stable.desktop";
"x-scheme-handler/http" = "${VARIABLES.defaultBrowser}.desktop"; "x-scheme-handler/http" = "${config.variables.defaultBrowser}.desktop";
"x-scheme-handler/https" = "${VARIABLES.defaultBrowser}.desktop"; "x-scheme-handler/https" = "${config.variables.defaultBrowser}.desktop";
}; };
}; };
} }

View File

@ -1,11 +1,11 @@
{ pkgs, ... }: { pkgs, config, ... }:
let VARIABLES = import ../src/variables.nix; in { {
home.packages = with pkgs; [ mpc-cli ]; home.packages = with pkgs; [ mpc-cli ];
services.mpd = { services.mpd = {
enable = true; enable = true;
musicDirectory = "/home/${VARIABLES.username}/Music"; musicDirectory = "/home/${config.variables.username}/Music";
}; };
xdg.configFile = { xdg.configFile = {

View File

@ -1,6 +1,6 @@
{ pkgs, ... }: { pkgs, config, ... }:
let VARIABLES = import ../src/variables.nix; in { {
users.defaultUserShell = pkgs.fish; users.defaultUserShell = pkgs.fish;
environment.shells = [ pkgs.fish ]; environment.shells = [ pkgs.fish ];
@ -76,7 +76,7 @@ let VARIABLES = import ../src/variables.nix; in {
jis = "recode shift_jis..utf8"; # Easily convert shift_jis-encoded files to utf8 jis = "recode shift_jis..utf8"; # Easily convert shift_jis-encoded files to utf8
utf16 = "recode utf16..utf8"; # Rarely, some files from Japan are utf16 instead utf16 = "recode utf16..utf8"; # Rarely, some files from Japan are utf16 instead
jp = "LANG=ja_JP.UTF-8 LC_ALL=ja_JP.UTF-8"; jp = "LANG=ja_JP.UTF-8 LC_ALL=ja_JP.UTF-8";
vm = /* fish */ ''cd ~/nix-config && crystal spec tests/main.cr --progress --verbose --tag local && nixos-rebuild build-vm --flake . --verbose && ./result/bin/run-${VARIABLES.hostname}-vm && trash put result ${VARIABLES.hostname}.qcow2''; vm = /* fish */ ''cd ~/nix-config && crystal spec tests/main.cr --progress --verbose --tag local && nixos-rebuild build-vm --flake . --verbose && ./result/bin/run-${config.variables.hostname}-vm && trash put result ${config.variables.hostname}.qcow2'';
sw = "cd ~/nix-config && crystal spec tests/main.cr --progress --verbose --tag local && sudo nixos-rebuild switch --flake . --verbose"; sw = "cd ~/nix-config && crystal spec tests/main.cr --progress --verbose --tag local && sudo nixos-rebuild switch --flake . --verbose";
st = "cd ~/nix-config && crystal spec tests/main.cr --progress --verbose --tag local"; st = "cd ~/nix-config && crystal spec tests/main.cr --progress --verbose --tag local";
tf = "treefmt"; tf = "treefmt";

View File

@ -1,6 +1,4 @@
{ pkgs, ... }: { pkgs, config, ... }: {
let VARIABLES = import ../src/variables.nix; in {
services.greetd = { services.greetd = {
enable = true; enable = true;
restart = false; restart = false;
@ -11,7 +9,7 @@ let VARIABLES = import ../src/variables.nix; in {
}; };
initial_session = { initial_session = {
command = "${pkgs.hyprland}/bin/Hyprland"; command = "${pkgs.hyprland}/bin/Hyprland";
user = VARIABLES.username; user = config.variables.username;
}; };
}; };
}; };

View File

@ -1,16 +1,16 @@
let VARIABLES = import ../src/variables.nix; in { { config, ... }: {
home-manager = { home-manager = {
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
sharedModules = [{ sharedModules = [{
home.stateVersion = VARIABLES.stateVersion; home.stateVersion = config.variables.stateVersion;
}]; }];
users = { users = {
user = { user = {
home.username = VARIABLES.username; home.username = config.variables.username;
home.homeDirectory = "/home/${VARIABLES.username}"; home.homeDirectory = "/home/${config.variables.username}";
}; };
}; };
}; };

View File

@ -1,6 +1,6 @@
let VARIABLES = import ../src/variables.nix; in { { config, ... }: {
networking = { networking = {
hostName = VARIABLES.hostname; hostName = config.variables.hostname;
networkmanager = { networkmanager = {
enable = true; enable = true;

View File

@ -1,8 +1,8 @@
let VARIABLES = import ../src/variables.nix; in { { config, ... }: {
users = { users = {
mutableUsers = false; mutableUsers = false;
users."${VARIABLES.username}" = { users."${config.variables.username}" = {
isNormalUser = true; isNormalUser = true;
uid = 1000; uid = 1000;
password = "user"; password = "user";

View File

@ -1,9 +1,4 @@
{ pkgs { pkgs, lib, config, ... }: {
, lib
, ...
}:
let VARIABLES = import ./variables.nix; in {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
grimblast grimblast
waycorner waycorner
@ -93,5 +88,5 @@ let VARIABLES = import ./variables.nix; in {
]; ];
environment.defaultPackages = [ ]; environment.defaultPackages = [ ];
system.stateVersion = VARIABLES.stateVersion; system.stateVersion = config.varables.stateVersion;
} }