forked from extern/nix-config
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:
parent
2f056d1e72
commit
8ffb196c0b
10
default.nix
10
default.nix
@ -1,4 +1,4 @@
|
|||||||
{ home-manager, stylix, lib, ... }:
|
{ home-manager, stylix, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
@ -12,12 +12,4 @@
|
|||||||
./specializations
|
./specializations
|
||||||
./src/main.nix
|
./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"; };
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ pkgs, config, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
home.packages = with pkgs; [ tig ];
|
home.packages = with pkgs; [ tig ];
|
||||||
@ -22,7 +22,7 @@
|
|||||||
quotePath = false;
|
quotePath = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
web.browser = config.variables.defaultBrowser;
|
web.browser = "librewolf";
|
||||||
push.default = "simple";
|
push.default = "simple";
|
||||||
branch.autosetuprebase = "always";
|
branch.autosetuprebase = "always";
|
||||||
init.defaultBranch = "master";
|
init.defaultBranch = "master";
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
{ pkgs, config, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
xdg.configFile."hypr/hyprland.conf".text = /* bash */ ''
|
xdg.configFile."hypr/hyprland.conf".text = /* bash */ ''
|
||||||
env=XCURSOR_SIZE,24
|
env=XCURSOR_SIZE,24
|
||||||
env=BROWSER,${config.variables.defaultBrowser}
|
env=BROWSER,librewolf
|
||||||
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
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, ... }: {
|
{
|
||||||
programs.kitty = {
|
programs.kitty = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
@ -7,7 +7,7 @@
|
|||||||
close_on_child_death = true;
|
close_on_child_death = true;
|
||||||
cursor_blink_interval = 0;
|
cursor_blink_interval = 0;
|
||||||
|
|
||||||
open_url_with = config.variables.defaultBrowser;
|
open_url_with = "librewolf";
|
||||||
wayland_titlebar_color = "background";
|
wayland_titlebar_color = "background";
|
||||||
|
|
||||||
allow_remote_control = true;
|
allow_remote_control = true;
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, ... }: {
|
{
|
||||||
xdg.mimeApps = {
|
xdg.mimeApps = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
@ -7,8 +7,8 @@
|
|||||||
"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" = "${config.variables.defaultBrowser}.desktop";
|
"x-scheme-handler/http" = "librewolf.desktop";
|
||||||
"x-scheme-handler/https" = "${config.variables.defaultBrowser}.desktop";
|
"x-scheme-handler/https" = "librewolf.desktop";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
{ pkgs, config, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
home.packages = with pkgs; [ mpc-cli ];
|
home.packages = with pkgs; [ mpc-cli ];
|
||||||
|
|
||||||
services.mpd = {
|
services.mpd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
musicDirectory = "/home/${config.variables.username}/Music";
|
musicDirectory = "/home/user/Music";
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg.configFile = {
|
xdg.configFile = {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ config, ... }: {
|
{
|
||||||
xdg.userDirs = {
|
xdg.userDirs = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
@ -6,11 +6,11 @@
|
|||||||
templates = null;
|
templates = null;
|
||||||
publicShare = null;
|
publicShare = null;
|
||||||
|
|
||||||
download = "/home/${config.variables.username}/ダウンロード";
|
download = "/home/user/ダウンロード";
|
||||||
documents = "/home/${config.variables.username}/ドキュメント";
|
documents = "/home/user/ドキュメント";
|
||||||
music = "/home/${config.variables.username}/音楽";
|
music = "/home/user/音楽";
|
||||||
pictures = "/home/${config.variables.username}/画像";
|
pictures = "/home/user/画像";
|
||||||
videos = "/home/${config.variables.username}/ビデオ";
|
videos = "/home/user/ビデオ";
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg.configFile."user-dirs.locale".text = "ja_JP";
|
xdg.configFile."user-dirs.locale".text = "ja_JP";
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ pkgs, config, ... }:
|
{ pkgs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
users.defaultUserShell = pkgs.fish;
|
users.defaultUserShell = pkgs.fish;
|
||||||
@ -76,7 +76,7 @@
|
|||||||
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-${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";
|
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";
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
{ pkgs, config, ... }: {
|
{ pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
services.greetd = {
|
services.greetd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
restart = false;
|
restart = false;
|
||||||
@ -9,7 +11,7 @@
|
|||||||
};
|
};
|
||||||
initial_session = {
|
initial_session = {
|
||||||
command = "${pkgs.hyprland}/bin/Hyprland";
|
command = "${pkgs.hyprland}/bin/Hyprland";
|
||||||
user = config.variables.username;
|
user = "user";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
{ config, ... }: {
|
{
|
||||||
home-manager = {
|
home-manager = {
|
||||||
useGlobalPkgs = true;
|
useGlobalPkgs = true;
|
||||||
useUserPackages = true;
|
useUserPackages = true;
|
||||||
|
|
||||||
sharedModules = [{
|
sharedModules = [{
|
||||||
home.stateVersion = config.variables.stateVersion;
|
home.stateVersion = "22.11";
|
||||||
}];
|
}];
|
||||||
|
|
||||||
users = {
|
users = {
|
||||||
user = {
|
user = {
|
||||||
home.username = config.variables.username;
|
home.username = "user";
|
||||||
home.homeDirectory = "/home/${config.variables.username}";
|
home.homeDirectory = "/home/user";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{ config, ... }: {
|
{
|
||||||
networking = {
|
networking = {
|
||||||
hostName = config.variables.hostname;
|
hostName = "nixos";
|
||||||
|
|
||||||
networkmanager = {
|
networkmanager = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
{ config, ... }: {
|
{
|
||||||
users = {
|
users = {
|
||||||
mutableUsers = false;
|
mutableUsers = false;
|
||||||
|
|
||||||
users."${config.variables.username}" = {
|
users = {
|
||||||
isNormalUser = true;
|
user = {
|
||||||
uid = 1000;
|
isNormalUser = true;
|
||||||
password = "user";
|
uid = 1000;
|
||||||
extraGroups = [ "wheel" "networkmanager" ];
|
password = "user";
|
||||||
|
extraGroups = [ "wheel" "networkmanager" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ pkgs, lib, config, ... }: {
|
{ pkgs, lib, ... }: {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
grimblast
|
grimblast
|
||||||
waycorner
|
waycorner
|
||||||
@ -88,5 +88,5 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
environment.defaultPackages = [ ];
|
environment.defaultPackages = [ ];
|
||||||
system.stateVersion = config.varables.stateVersion;
|
system.stateVersion = "22.11";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user