meta: Don't use variables

The previous commit didn't actually work, and I shouldn't need to
change the variables often, so it's much simpler to not have them.

In the event that I do need to change something, rg and sd should get
the job done well.
This commit is contained in:
Donovan Glover 2023-06-22 11:00:39 -04:00
parent 2f056d1e72
commit 8ffb196c0b
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65
13 changed files with 40 additions and 44 deletions

View File

@ -1,4 +1,4 @@
{ home-manager, stylix, lib, ... }:
{ home-manager, stylix, ... }:
{
imports = [
@ -12,12 +12,4 @@
./specializations
./src/main.nix
];
options.variables = {
hostname = lib.mkOption { default = "nixos"; };
hostHardwareConfiguration = lib.mkOption { default = ./hardware/laptop.nix; };
stateVersion = lib.mkOption { default = "22.11"; };
username = lib.mkOption { default = "user"; };
defaultBrowser = lib.mkOption { default = "librewolf"; };
};
}

View File

@ -1,4 +1,4 @@
{ pkgs, config, ... }:
{ pkgs, ... }:
{
home.packages = with pkgs; [ tig ];
@ -22,7 +22,7 @@
quotePath = false;
};
web.browser = config.variables.defaultBrowser;
web.browser = "librewolf";
push.default = "simple";
branch.autosetuprebase = "always";
init.defaultBranch = "master";

View File

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

View File

@ -1,4 +1,4 @@
{ config, ... }: {
{
programs.kitty = {
enable = true;
@ -7,7 +7,7 @@
close_on_child_death = true;
cursor_blink_interval = 0;
open_url_with = config.variables.defaultBrowser;
open_url_with = "librewolf";
wayland_titlebar_color = "background";
allow_remote_control = true;

View File

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

View File

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

View File

@ -1,4 +1,4 @@
{ config, ... }: {
{
xdg.userDirs = {
enable = true;
@ -6,11 +6,11 @@
templates = null;
publicShare = null;
download = "/home/${config.variables.username}/";
documents = "/home/${config.variables.username}/";
music = "/home/${config.variables.username}/";
pictures = "/home/${config.variables.username}/";
videos = "/home/${config.variables.username}/";
download = "/home/user/";
documents = "/home/user/";
music = "/home/user/";
pictures = "/home/user/";
videos = "/home/user/";
};
xdg.configFile."user-dirs.locale".text = "ja_JP";

View File

@ -1,4 +1,4 @@
{ pkgs, config, ... }:
{ pkgs, ... }:
{
users.defaultUserShell = pkgs.fish;
@ -76,7 +76,7 @@
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-${config.variables.hostname}-vm && trash put result ${config.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-nixos-vm && trash put result nixos.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,4 +1,6 @@
{ pkgs, config, ... }: {
{ pkgs, ... }:
{
services.greetd = {
enable = true;
restart = false;
@ -9,7 +11,7 @@
};
initial_session = {
command = "${pkgs.hyprland}/bin/Hyprland";
user = config.variables.username;
user = "user";
};
};
};

View File

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

View File

@ -1,6 +1,6 @@
{ config, ... }: {
{
networking = {
hostName = config.variables.hostname;
hostName = "nixos";
networkmanager = {
enable = true;

View File

@ -1,12 +1,14 @@
{ config, ... }: {
{
users = {
mutableUsers = false;
users."${config.variables.username}" = {
isNormalUser = true;
uid = 1000;
password = "user";
extraGroups = [ "wheel" "networkmanager" ];
users = {
user = {
isNormalUser = true;
uid = 1000;
password = "user";
extraGroups = [ "wheel" "networkmanager" ];
};
};
};
}

View File

@ -1,4 +1,4 @@
{ pkgs, lib, config, ... }: {
{ pkgs, lib, ... }: {
environment.systemPackages = with pkgs; [
grimblast
waycorner
@ -88,5 +88,5 @@
];
environment.defaultPackages = [ ];
system.stateVersion = config.varables.stateVersion;
system.stateVersion = "22.11";
}