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 ];
xdg.configFile."tig/config".text = ''
@ -22,7 +22,7 @@ let VARIABLES = import ../src/variables.nix; in {
quotePath = false;
};
web.browser = VARIABLES.defaultBrowser;
web.browser = config.variables.defaultBrowser;
push.default = "simple";
branch.autosetuprebase = "always";
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 */ ''
env=XCURSOR_SIZE,24
env=BROWSER,${VARIABLES.defaultBrowser}
env=BROWSER,${config.variables.defaultBrowser}
env=GTK_IM_MODULE,fcitx
env=QT_IM_MODULE,fcitx
env=XMODIFIERS,@im=fcitx

View File

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

View File

@ -1,4 +1,4 @@
let VARIABLES = import ../src/variables.nix; in {
{ config, ... }: {
xdg.mimeApps = {
enable = true;
@ -7,8 +7,8 @@ let VARIABLES = import ../src/variables.nix; in {
"image/jpeg" = "feh.desktop";
"image/gif" = "org.qutebrowser.qutebrowser.desktop";
"application/x-wine-extension-osz" = "osu-stable.desktop";
"x-scheme-handler/http" = "${VARIABLES.defaultBrowser}.desktop";
"x-scheme-handler/https" = "${VARIABLES.defaultBrowser}.desktop";
"x-scheme-handler/http" = "${config.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 ];
services.mpd = {
enable = true;
musicDirectory = "/home/${VARIABLES.username}/Music";
musicDirectory = "/home/${config.variables.username}/Music";
};
xdg.configFile = {

View File

@ -1,6 +1,6 @@
{ pkgs, ... }:
{ pkgs, config, ... }:
let VARIABLES = import ../src/variables.nix; in {
{
users.defaultUserShell = 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
utf16 = "recode utf16..utf8"; # Rarely, some files from Japan are utf16 instead
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";
st = "cd ~/nix-config && crystal spec tests/main.cr --progress --verbose --tag local";
tf = "treefmt";

View File

@ -1,6 +1,4 @@
{ pkgs, ... }:
let VARIABLES = import ../src/variables.nix; in {
{ pkgs, config, ... }: {
services.greetd = {
enable = true;
restart = false;
@ -11,7 +9,7 @@ let VARIABLES = import ../src/variables.nix; in {
};
initial_session = {
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 = {
useGlobalPkgs = true;
useUserPackages = true;
sharedModules = [{
home.stateVersion = VARIABLES.stateVersion;
home.stateVersion = config.variables.stateVersion;
}];
users = {
user = {
home.username = VARIABLES.username;
home.homeDirectory = "/home/${VARIABLES.username}";
home.username = config.variables.username;
home.homeDirectory = "/home/${config.variables.username}";
};
};
};

View File

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

View File

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

View File

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