massive refactoring

This commit is contained in:
Dmitriy Kholkin 2021-02-07 02:38:11 +03:00
parent 2c078c583a
commit 3bc9bb904c
61 changed files with 1594 additions and 527 deletions

View File

@ -1,14 +0,0 @@
{ config, pkgs, lib, inputs, name, ... }:
rec {
device = name;
imports = [
(./hardware-configuration + "/${name}.nix")
(import inputs.base16.hmModule)
(import ./modules device)
];
home-manager.users.alukard.home.stateVersion = "20.09";
system.stateVersion = "20.09";
}

71
flake.lock generated
View File

@ -39,11 +39,11 @@
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1606046962,
"narHash": "sha256-244JrrVFht/VMRItDcDlrcwejqpqJInDUWA/x6mucW4=",
"lastModified": 1612646749,
"narHash": "sha256-m2o9E4PHMJHRrp9udYfPp/onqY9flMD2dTKJuhvp7TM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "a3a0f1289acac24ce2ffe0481bf8cabd3a6ccc64",
"rev": "6dfa9ef85cf4e23ec42f34c9e988baaf793617a1",
"type": "github"
},
"original": {
@ -71,11 +71,11 @@
"materia-theme": {
"flake": false,
"locked": {
"lastModified": 1601330353,
"narHash": "sha256-zOi6nwJ23UdPbIvEc4gAHk/6aFVkK1Uuy2D/65gvuOI=",
"lastModified": 1606538708,
"narHash": "sha256-Sje1j/k+g0MXP1wQi+KSVXIt1LQPeJ5KYJwfyxgmxPw=",
"owner": "nana-4",
"repo": "materia-theme",
"rev": "e329aaee160c82e85fe91a6467c666c7f9f2a7df",
"rev": "c63ca3285c4b5fcd652d1f054745251c60d4c32e",
"type": "github"
},
"original": {
@ -84,6 +84,23 @@
"type": "github"
}
},
"nix": {
"inputs": {
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1612537053,
"narHash": "sha256-3y05uB7OkEtWngIKYx+xiY+oG+1QPvRROJkKBxO1XFc=",
"owner": "NixOS",
"repo": "nix",
"rev": "480426a364f09e7992230b32f2941a09fb52d729",
"type": "github"
},
"original": {
"id": "nix",
"type": "indirect"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1593360652,
@ -117,11 +134,11 @@
},
"nixpkgs-old": {
"locked": {
"lastModified": 1606344557,
"narHash": "sha256-IVIMVKWNNt6VODiLfINaW6sfrWPw5ZT91GQMgLUl7ZA=",
"lastModified": 1612568312,
"narHash": "sha256-DbJ2aiZaFBYUTscEfjOqW/v1bCSE35X2g0rfmQQLEUs=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "ffb3aab257e8851b558cdc6079241a7eb0c7239e",
"rev": "22a2b332378b99461edeaf9754dc2d6b4a210148",
"type": "github"
},
"original": {
@ -133,11 +150,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1606518375,
"narHash": "sha256-foO4ZgJa4YnKG3limxeCT6DeLr249XkUdGJx6fORaNc=",
"lastModified": 1612647598,
"narHash": "sha256-XAXgwTCxwvHxhvSKWSwkA0FGsRepTgoXHwHNx2ww5sg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "da8bd7747d143d81718ea4fdff971479ad027b94",
"rev": "d1dc3064b974503e9f90d5bceaf0a3b4b030b86d",
"type": "github"
},
"original": {
@ -147,11 +164,26 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1605988311,
"narHash": "sha256-PA+kgq46NApOAJlmBNJHs5DwsIrY+jodM0e4g7VtXyY=",
"lastModified": 1602702596,
"narHash": "sha256-fqJ4UgOb4ZUnCDIapDb4gCrtAah5Rnr2/At3IzMitig=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ad0d20345219790533ebe06571f82ed6b034db31",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-20.09-small",
"type": "indirect"
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1612545171,
"narHash": "sha256-AZkSuO7H055eDD4KWBEDCX/R5fvw0vUMCErvQvYSEhA=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "2247d824fe07f16325596acc7faa286502faffd1",
"rev": "536fe36e23ab0fc8b7f35c24603422eee9fc17a2",
"type": "github"
},
"original": {
@ -168,7 +200,8 @@
"home-manager": "home-manager",
"i3lock-fancy-rapid": "i3lock-fancy-rapid",
"materia-theme": "materia-theme",
"nixpkgs": "nixpkgs_3",
"nix": "nix",
"nixpkgs": "nixpkgs_4",
"nixpkgs-mozilla": "nixpkgs-mozilla",
"nixpkgs-old": "nixpkgs-old",
"spotify-tui": "spotify-tui",
@ -181,11 +214,11 @@
"spotify-tui": {
"flake": false,
"locked": {
"lastModified": 1606232808,
"narHash": "sha256-Xf8wOyjceEXpCJuaQcTH586QLBwej4blndzq3u8IkbY=",
"lastModified": 1612427519,
"narHash": "sha256-9N+0DUsCNZhw4QViJxmbTWxvFV9X6wyrzlYVjtHhJG8=",
"owner": "Rigellute",
"repo": "spotify-tui",
"rev": "5bbc0848bfaa4a63b744f5cd045874d87d87c7ac",
"rev": "38c095884919bebc6c592d3662ddd1f9a93131f1",
"type": "github"
},
"original": {

View File

@ -8,7 +8,7 @@
# nix.url = github:nixos/nix/6ff9aa8df7ce8266147f74c65e2cc529a1e72ce0;
home-manager.url = github:nix-community/home-manager;
base16.url = github:alukardbf/base16-nix;
# base16.url = "/shared/nixos/base16-nix";
# base16.url = "/media/base16";
base16-horizon-scheme = {
url = github:michael-ball/base16-horizon-scheme;
flake = false;
@ -47,41 +47,45 @@
};
};
outputs = { nixpkgs, self, ... }@inputs: {
outputs = { nixpkgs, nix, self, ... }@inputs: {
nixosModules = import ./modules;
nixosProfiles = import ./profiles;
# Generate system config for each of hardware configuration
nixosConfigurations = with nixpkgs.lib;
let
hosts = map (fname: builtins.head (builtins.match "(.*)\\.nix" fname))
(builtins.attrNames (builtins.readDir ./hardware-configuration));
hosts = builtins.attrNames (builtins.readDir ./machines);
mkHost = name: let
system = "x86_64-linux";
pkgs = inputs.nixpkgs.legacyPackages.${system};
inherit (inputs.nixpkgs) lib;
# pkgs = inputs.nixpkgs.legacyPackages.${system};
# inherit (inputs.nixpkgs) lib;
specialArgsOld = {
inherit inputs;
};
specialArgs = specialArgsOld // {
inherit name;
};
# specialArgsOld = {
# inherit inputs;
# };
# specialArgs = specialArgsOld // {
# inherit name;
# };
hm-nixos-as-super = { config, ... }: {
options.home-manager.users = lib.mkOption {
type = lib.types.attrsOf (lib.types.submoduleWith {
modules = [ ];
specialArgs = specialArgsOld // {
super = config;
};
});
};
};
# hm-nixos-as-super = { config, ... }: {
# options.home-manager.users = lib.mkOption {
# type = lib.types.attrsOf (lib.types.submoduleWith {
# modules = [ ];
# specialArgs = specialArgsOld // {
# super = config;
# };
# });
# };
# };
modules = [
(import ./default.nix)
inputs.home-manager.nixosModules.home-manager
hm-nixos-as-super
];
# modules = [
# (import ./default.nix)
# inputs.home-manager.nixosModules.home-manager
# hm-nixos-as-super
# ];
system = builtins.readFile (./machines + "/${name}/system");
modules = [ (import (./machines + "/${name}")) { device = name; } ];
specialArgs = { inherit inputs; };
in nixosSystem { inherit system modules specialArgs; };
in genAttrs hosts mkHost;

View File

@ -1,32 +0,0 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [ ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/9affc545-6755-4b5b-b820-36ebb1119330";
fsType = "f2fs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/4D6C-D3AB";
fsType = "vfat";
};
swapDevices = [
{
device = "/dev/disk/by-partuuid/5ff8b0ed-a111-4399-916a-8e49ccb3dd4d";
randomEncryption.enable = true;
}
];
virtualisation.virtualbox.guest.enable = true;
}

View File

@ -1,15 +1,16 @@
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p perl
#! nix-shell -i bash -p perl -p gptfdisk -p parted
set -e
CONFIG_FOLDER="$(dirname "$(pwd)")"
DEVICE_NAME=Dell-Laptop
MAX_JOBS=8
SWAP_SIZE=8GiB
NIXOS_COMMIT="1dc37370c489b610f8b91d7fdd40633163ffbafd"
USE_ECNRYPTION=true
ZFS_ARC_MAX=4294967296 # Max ARC cache size. default = 4GiB
DEVICE_NAME=NixOS-VM
MAX_JOBS=4
SWAP_SIZE=2GiB
NIXOS_COMMIT="84917aa00bf23c88e5874c683abe05edb0ba4078"
USE_ECNRYPTION=false
ZFS_ARC_MAX=1073741824 # Max ARC cache size. default = 4GiB
# ZFS_ARC_MAX=4294967296 # Max ARC cache size. default = 4GiB
ZFS_ASHIFT=12 # recommended=12 which 1<<12 (4096)
clean_stdin() {
@ -164,6 +165,7 @@ pprint "Create ZFS datasets"
zfs create -o mountpoint=none rpool/local
zfs create -o mountpoint=legacy -o com.sun:auto-snapshot=false -o atime=off -o recordsize=16K rpool/local/bittorrent
zfs create -o mountpoint=legacy -o com.sun:auto-snapshot:frequent=false -o com.sun:auto-snapshot:monthly=false -o atime=off rpool/local/nix
zfs create -o mountpoint=legacy -o xattr=sa -o atime=off -o recordsize=8K -o com.sun:auto-snapshot:frequent=false rpool/local/libvirt
zfs create -o mountpoint=none -o com.sun:auto-snapshot:frequent=false rpool/system
zfs create -o mountpoint=legacy rpool/system/root
zfs create -o mountpoint=legacy -o xattr=sa -o acltype=posixacl rpool/system/var
@ -186,6 +188,10 @@ mount -t zfs rpool/system/var /mnt/var
mkdir /mnt/home
mount -t zfs rpool/user/home /mnt/home
mkdir -p /mnt/home/alukard/.libvirt
chown -R 1000:100 /mnt/home/alukard
mount -t zfs rpool/local/libvirt /mnt/home/alukard/.libvirt
mkdir /mnt/bittorrent
mount -t zfs rpool/local/bittorrent /mnt/bittorrent
@ -228,9 +234,9 @@ if [[ "$SWAP" != "NONE" ]]; then
fi
pprint "Copy minimal config to destination system"
cp /mnt/etc/nixos/hardware-configuration.nix $CONFIG_FOLDER/hardware-configuration/$DEVICE_NAME.nix
cp /mnt/etc/nixos/hardware-configuration.nix $CONFIG_FOLDER/machines/$DEVICE_NAME/hardware-configuration.nix
# Change <not-detected> for flakes
sed -i 's#<nixpkgs/nixos/modules/installer/scan/not-detected.nix>#"${inputs.nixpkgs}/nixos/modules/installer/scan/not-detected.nix"#' $CONFIG_FOLDER/hardware-configuration/$DEVICE_NAME.nix
sed -i 's#<nixpkgs/nixos/modules/installer/scan/not-detected.nix>#"${inputs.nixpkgs}/nixos/modules/installer/scan/not-detected.nix"#' $CONFIG_FOLDER/machines/$DEVICE_NAME/hardware-configuration.nix
cp ./min-config.nix /mnt/etc/nixos/configuration.nix
sed -i "s#changeme#${DEVICE_NAME}#" /mnt/etc/nixos/configuration.nix
@ -240,6 +246,8 @@ echo
if [[ "$REPLY" =~ ^[Yy]$ ]]
then
nixos-install -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/$NIXOS_COMMIT.tar.gz --max-jobs $MAX_JOBS --no-root-passwd
mkdir -p /mnt/home/alukard/nixos-config
cp -aT $CONFIG_FOLDER /mnt/home/alukard/nixos-config
fi
pprint "Copy config to destination system"
mkdir -p /mnt/home/alukard/nixos-config
cp -aT $CONFIG_FOLDER /mnt/home/alukard/nixos-config

View File

@ -46,7 +46,7 @@
nix = {
useSandbox = true;
autoOptimiseStore = true;
# autoOptimiseStore = true;
optimise.automatic = true;
extraOptions = ''
experimental-features = nix-command flakes
@ -60,7 +60,7 @@
keyMap = "us";
};
time.timeZone = "Europe/Volgograd";
time.timeZone = "Europe/Moscow";
environment.systemPackages = with pkgs; [ git ];

View File

@ -0,0 +1,27 @@
{ inputs, ... }: {
imports = [
./hardware-configuration.nix
inputs.self.nixosProfiles.desktop
];
deviceSpecific.devInfo = {
cpu = {
vendor = "amd";
clock = 3700;
cores = 6;
};
drive = {
type = "ssd";
speed = 6000;
size = 1000;
};
gpu = {
vendor = "amd";
};
bigScreen = true;
ram = 16;
};
deviceSpecific.isHost = true;
deviceSpecific.isShared = false;
deviceSpecific.isGaming = true;
deviceSpecific.enableVirtualisation = true;
}

View File

@ -0,0 +1 @@
x86_64-linux

View File

@ -0,0 +1,28 @@
{ inputs, ... }: {
imports = with inputs.self.nixosModules; [
./hardware-configuration.nix
inputs.self.nixosProfiles.desktop
];
deviceSpecific.devInfo = {
cpu = {
vendor = "intel";
clock = 3600;
cores = 4;
};
drive = {
type = "ssd";
speed = 3000;
size = 250;
};
gpu = {
vendor = "intel";
};
bigScreen = false;
ram = 16;
};
deviceSpecific.isHost = false;
deviceSpecific.isShared = false;
deviceSpecific.isGaming = true;
deviceSpecific.enableVirtualisation = false;
}

View File

@ -38,6 +38,11 @@
fsType = "zfs";
};
fileSystems."/home/alukard/.libvirt" =
{ device = "rpool/local/libvirt";
fsType = "zfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/4F6D-537A";
fsType = "vfat";

View File

@ -0,0 +1 @@
x86_64-linux

View File

@ -0,0 +1,27 @@
{ inputs, ... }: {
imports = [
./hardware-configuration.nix
inputs.self.nixosProfiles.desktop
];
deviceSpecific.devInfo = {
cpu = {
vendor = "amd";
clock = 3700;
cores = 4;
};
drive = {
type = "ssd";
speed = 1000;
size = 30;
};
gpu = {
vendor = "vm";
};
bigScreen = true;
ram = 4;
};
deviceSpecific.isHost = false;
deviceSpecific.isShared = false;
deviceSpecific.isGaming = false;
deviceSpecific.enableVirtualisation = false;
}

View File

@ -0,0 +1,61 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [ ];
boot.initrd.availableKernelModules = [ "ata_piix" "xhci_pci" "ahci" "sd_mod" "sr_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "rpool/system/root";
fsType = "zfs";
};
fileSystems."/nix" =
{ device = "rpool/local/nix";
fsType = "zfs";
};
fileSystems."/var" =
{ device = "rpool/system/var";
fsType = "zfs";
};
fileSystems."/home" =
{ device = "rpool/user/home";
fsType = "zfs";
};
fileSystems."/home/alukard/.libvirt" =
{ device = "rpool/local/libvirt";
fsType = "zfs";
};
fileSystems."/bittorrent" =
{ device = "rpool/local/bittorrent";
fsType = "zfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/9D49-7087";
fsType = "vfat";
};
swapDevices = [
{
device = "/dev/disk/by-partuuid/6e22eab7-2e47-4108-bd97-76e3bdc2c6c1";
randomEncryption.enable = true;
}
];
virtualisation.virtualbox.guest.enable = true;
networking.hostId = "524df2e8";
boot.zfs.devNodes = "/dev/disk/by-partuuid/37beaf62-685a-43b2-95b2-e777a77993e1";
boot.supportedFilesystems = [ "zfs" ];
boot.kernelParams = [ "zfs.zfs_arc_max=1073741824" ];
}

1
machines/NixOS-VM/system Normal file
View File

@ -0,0 +1 @@
x86_64-linux

BIN
misc/wallpaper Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

View File

@ -7,7 +7,7 @@ with config.deviceSpecific;
};
config = rec {
defaultApplications = {
term = if isLaptop then {
term = if (isLaptop || isVM) then {
cmd = "${pkgs.kitty}/bin/kitty";
desktop = "kitty";
} else {
@ -63,6 +63,12 @@ with config.deviceSpecific;
# desktop = "gnumeric";
# };
};
environment.sessionVariables = {
EDITOR = config.defaultApplications.editor.cmd;
VISUAL = config.defaultApplications.editor.cmd;
};
home-manager.users.alukard.xdg.mimeApps = {
enable = true;
defaultApplications =
@ -70,22 +76,20 @@ with config.deviceSpecific;
builtins.mapAttrs (name: value:
if value ? desktop then [ "${value.desktop}.desktop" ] else value) {
"text/html" = browser;
# "image/*" = { desktop = "org.kde.gwenview"; };
# "image/*" = { desktop = "org.gnome.eog"; };
"application/x-bittorrent" = torrent;
"application/zip" = archive;
"application/rar" = archive;
"application/7z" = archive;
"application/*tar" = archive;
"application/x-kdenlive" = archive;
"x-scheme-handler/http" = browser;
"x-scheme-handler/https" = browser;
"x-scheme-handler/about" = browser;
"x-scheme-handler/unknown" = browser;
# "x-scheme-handler/mailto" = mail;
"application/pdf" = pdf;
# "application/pdf" = { desktop = "org.kde.okular"; };
# "application/vnd.openxmlformats-officedocument.wordprocessingml.document" =
# text_processor;
# text_processor;
# "application/msword" = text_processor;
# "application/vnd.oasis.opendocument.text" = text_processor;
# "text/csv" = spreadsheet;

View File

@ -2,11 +2,10 @@
let
thm = config.lib.base16.theme;
in
with config.deviceSpecific;
{
home-manager.users.alukard = {
programs.alacritty = {
enable = !isLaptop;
enable = !config.deviceSpecific.isLaptop;
settings = {
font = {
normal = {

View File

@ -2,11 +2,10 @@
let
thm = config.lib.base16.theme;
in
with config.deviceSpecific;
{
home-manager.users.alukard = {
programs.kitty = {
enable = isLaptop;
enable = config.deviceSpecific.isLaptop;
font.name = "${thm.powerlineFont} ${thm.smallFontSize}";
# keybindings = ''
# '';

View File

@ -1,15 +1,14 @@
{ config, lib, pkgs, ... }:
with config.deviceSpecific;
{
home-manager.users.alukard.programs.mpv = {
enable = true;
config = {
vo = "gpu";
hwdec = if video == "nvidia" then
hwdec = if config.deviceSpecific.devInfo.gpu.vendor == "nvidia" then
"vdpau"
else
"vaapi";
ytdl-format = if isLaptop then
ytdl-format = if config.deviceSpecific.isLaptop then
"bestvideo[height<=?1080]+bestaudio/best"
else
"bestvideo+bestaudio/best";

View File

@ -1,15 +1,20 @@
{ pkgs, config, lib, ... }:
with rec {
inherit (config) device deviceSpecific;
};
with deviceSpecific; {
with config.deviceSpecific; {
programs.adb.enable = true;
programs.java = {
enable = true;
package = if (device == "AMD-Workstation") then pkgs.jdk13 else pkgs.jre;
package = if (config.device == "AMD-Workstation") then pkgs.jdk13 else pkgs.jre;
};
# Install cdemu for some gaming purposes
# programs.cdemu = {
# enable = true;
# image-analyzer = false;
# gui = false;
# group = "cdrom";
# };
home-manager.users.alukard.home.packages = with pkgs; [
# cli
advance-touch
@ -24,7 +29,8 @@ with deviceSpecific; {
nix-prefetch-git
nix-prefetch-github
nomino
(p7zip.override { enableUnfree = true; })
# (p7zip.override { enableUnfree = true; })
p7zip
pciutils
pinfo
ripgrep
@ -66,6 +72,7 @@ with deviceSpecific; {
zathura
# audacity # fixit
# quodlibet
spicetify-cli
] ++ lib.optionals (!isVM) [
# rust-stable
libreoffice
@ -82,8 +89,10 @@ with deviceSpecific; {
] ++ lib.optionals isLaptop [
# acpi
# blueman
] ++ lib.optionals (device == "AMD-Workstation") [
] ++ lib.optionals (config.device == "AMD-Workstation") [
# xonar-fp
] ++ lib.optionals (enableVirtualisation) [
virt-manager
];
}

View File

@ -0,0 +1,51 @@
[CherryBlossom]
main_fg = d98ba1
secondary_fg = 816e7c
main_bg = 131c26
sidebar_and_player_bg = 131c26
#tl_selected_hover = EEEEEE
cover_overlay_and_shadow = 816e7c
indicator_fg_and_button_bg = d98ba1
pressing_fg = d98ba1
slider_bg = 131c26
sidebar_indicator_and_hover_button_bg = d98ba1
scrollbar_fg_and_selected_row_bg = 131c26
pressing_button_fg = 816e7c
pressing_button_bg = d98ba1
selected_button = 816e7c
miscellaneous_bg = 131c26
miscellaneous_hover_bg = 131c26
preserve_1 = 131c26
[Coral]
main_fg = f88379
secondary_fg = 8c92ac
main_bg = 1d1f28
sidebar_and_player_bg = 1d1f28
#tl_selected_hover = EEEEEE
cover_overlay_and_shadow = 8c92ac
indicator_fg_and_button_bg = f88379
pressing_fg = f88379
slider_bg = 1d1f28
sidebar_indicator_and_hover_button_bg = f88379
scrollbar_fg_and_selected_row_bg = 1d1f28
pressing_button_fg = 8c92ac
pressing_button_bg = f88379
selected_button = 8c92ac
miscellaneous_bg = 1d1f28
miscellaneous_hover_bg = 1d1f28
preserve_1 = 1d1f28
#Greyish Pink = #c79da9
#Purplish grey = #816e7c
#Very dark (mostly black) blue = #131c26
#NEED TO DO
#corner radius when hovering to edit playlist image
#downloaded status is fully colored
#connect to device shadow

View File

@ -0,0 +1,7 @@
{ config, lib, pkgs, ... }: {
home-manager.users.alukard = {
xdg.configFile."spicetify/Themes/base16/color.ini".source = ./color.ini;
xdg.configFile."spicetify/Themes/base16/user.css".source = ./user.css;
};
}

View File

@ -0,0 +1,647 @@
:root {
--bar-height: 120px;
}
/*Round corner cover image*/
.card-image,
.card-placeholder-wrapper,
.card-image-content-wrapper,
.Card:not(.Card--artist) .Card__image,
.Card:not(.Card--artist) .Card__image-wrapper {
border-radius: 10px !important;
overflow: hidden !important
}
/*Hide some annoying elements like profile name and pic, upgrade button and device connect bar at bottom, new playlist button*/
.profile.content-top-bar__profile-link,
.upgrade-button,
.view-player .remote-playback-bar,
.NewPlaylistButton {
display: none !important;
}
/*Exclude these elements from draggable property because it stops them from clickable*/
.profile-items-container,
.profile {
-webkit-app-region: no-drag !important;
}
/*Thinner scrollbar*/
::-webkit-scrollbar {
height: 6px !important;
width: 6px !important;
background-color: transparent;
}
/*Round corner scrollbar*/
::-webkit-scrollbar-thumb {
border-radius: 3px !important;
}
/*Hide top and bottom buttons of scrollbar */
/*who uses those, lol*/
::-webkit-scrollbar-button {
display: none !important;
}
/*Hide cover image overlay*/
.card-overlay {
visibility: hidden !important;
}
/*Lift up cover when hovering on it*/
.card-image-content-wrapper,
.Card:not(.Card--artist) .Card__image-wrapper {
transition-property: transform, box-shadow !important;
transition-duration: 1s !important;
transition-timing-function: cubic-bezier(.3,0,0,1) !important;
box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}
.card-image-hit-area:not(.no-hover):hover .card-image-content-wrapper,
.Card:not(.Card--artist) .Card__image-hit-area-counter-scale:hover .Card__image-wrapper {
transform: translateY(-10px);
box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}
.card-image-hit-area .card-button-add,
.card-image-hit-area .card-button-play,
.card-image-hit-area .card-button-more,
.Card__image-hit-area .card-button-add,
.Card__image-hit-area .card-button-play,
.Card__image-hit-area .card-button-more,
.Card__image-hit-area .Card__play-button,
.Card__image-hit-area .Card__add-button,
.Card__image-hit-area .Card__more-button,
.Card__image-hit-area .Card__overlay {
transition-property: all !important;
transition-duration: 1s !important;
transition-timing-function: cubic-bezier(.3,0,0,1) !important;
opacity: 0 !important;
}
.card-image-hit-area:not(.no-hover):hover .card-button-add,
.card-image-hit-area:not(.no-hover):hover .card-button-play,
.card-image-hit-area:not(.no-hover):hover .card-button-more,
.Card__image-hit-area:not(.no-hover):hover .card-button-add,
.Card__image-hit-area:not(.no-hover):hover .card-button-play,
.Card__image-hit-area:not(.no-hover):hover .card-button-more {
opacity: 1 !important;
transform: translateY(-10px);
}
.Card__image-hit-area:hover .Card__play-button,
.Card__image-hit-area:hover .Card__add-button,
.Card__image-hit-area:hover .Card__more-button,
.Card__image-hit-area:hover .Card__overlay {
opacity: 1 !important;
}
.glue-page-header__content .glue-page-header__image-inner {
border-radius: 10px;
box-shadow: unset !important;
}
.glue-page-header__full-description-overlay {
box-shadow: unset !important;
}
.card-placeholder-wrapper {
background: transparent !important;
}
/*Spice up search input background*/
.SearchInput {
color: var(--modspotify_main_fg);
}
.SearchInput__input {
color: var(--modspotify_secondary_fg);
background-color: rgba(var(--modspotify_rgb_scrollbar_fg_and_selected_row_bg), 0.5) !important;
border-radius: 4px !important;
padding-left: 34px;
}
.sidebar:hover .sidebar-navbar.sidebar-scroll-element {
opacity: 1!important;
}
.view-player .player-controls-container,
.view-player .player-controls-container .controls {
overflow: visible !important;
}
.view-player .player-controls-container .controls .button-play{
height:50px !important;
border-radius:50px !important;
background: transparent !important;
box-shadow:0 0 0 0 !important;
width:50px !important;
overflow: visible !important;
box-shadow: 0 4px 15px rgba(0,0,0,0.2) !important;
transition:none 0.3s cubic-bezier(.3,0,.7,1);
}
.view-player .player-controls-container .controls .button-play:before{
font-size:18px !important;
padding-left: 16px !important;
padding-top: 9px !important;
}
.view-player .player-controls-container .controls .button-play:after {
box-shadow: unset !important;
}
.view-player .player-controls-container {
position: absolute !important;
width: 100% !important;
}
.view-player .player-controls-container .controls {
width: 100% !important;
height: 100% !important;
align-items: center !important;
margin-top : 0px !important;
}
/*
Hide the song duration and elapsed text. I dont know where to put those so I just hide them
*/
.view-player .player-controls-container .progress-container .elapsed,
.view-player .player-controls-container .progress-container .remaining {
display: none !important;
}
/* Add round corner for Gerne and Mood cards */
.gc-image-container,
.gc-image {
border-radius: 10px !important;
}
/*
Collage of 3 album covers is usually seen in Browse and Chart.
*/
.card-puff__image-wrapper,
.card-puff__info-container,
.card-puff__card-image {
border-radius: 10px !important;
}
.card-puff__image-wrapper {
overflow: visible;
}
.card-puff__card-image {
box-shadow: 5px 0 30px rgba(0,0,0,0.7);
overflow: visible;
}
.card-puff__title-container {
background-color: transparent !important;
}
.card-puff.pressed .card-puff__image-wrapper,
.card-puff.pressed .card-puff__info-container {
opacity: 0.7 !important;
}
.card-puff__title {
padding: 5px 10px 5px 10px !important;
background-color: var(--modspotify_main_bg) !important;
border-radius: 4px;
border: 2px solid var(--modspotify_main_fg);
}
/*
We use round corner on cover so they look weird in original
form, so I move last cover to the right 20px and first one to the left 20px
*/
.card-puff__card-image:nth-child(1) {
right: 20px;
box-shadow: 0 0 0 0 !important;
}
.card-puff__card-image:nth-child(3) {
left: 20px;
}
.grid-overlay-label {
top: 140px !important;
}
/**/
.glue-page-header__background-color {
background-image: none !important;
background: var(--modspotify_main_bg);
}
/* .glue-page-header__sticky {
padding-top: 60px !important;
} */
/*
Remove those title, cringy description and
meaningless followers number
*/
.carousel .card-info-subtitle-description,
.carousel .card-info-subtitle-metadata,
.carousel .card:not(.card-type-station).card-info-title,
.carousel .card.card-type-playlist.image-loaded .card-info-subtitle-description,
.carousel .card.card-type-playlist.image-loaded .card-info-subtitle-metadata {
display: none !important;
}
/*
In top of Browse usually has bunch of Playlist or Album cards,
and they has .carousel as a wrapper and it hides anything that
overflows from its zone, aka our shadow and lifting animation.
*/
.carousel {
overflow: visible !important;
}
/*
Button with text Play
*/
.button.button-green,
.GlueButton.GlueButton--style-green {
color: var(--modspotify_main_bg) !important;
}
/*
Change text color in playlist
*/
.tl-explicit .label,
.tl-premium .label,
.tl-cell:not(.tl-number),
.tl-cell a:link,
.tl-highlight {
color: var(--modspotify_secondary_fg);
}
.card-type-album .card-info-title,
.card-type-track .card-info-title,
.card-type-collection-album .card-info-title,
.card-type-episode .card-info-title {
font-size: 15px;
font-weight: 900 !important;
text-align: center !important;
width: 100% !important;
}
.card-type-album .card-info-subtitle-links,
.card-type-track .card-info-subtitle-links,
.card-type-collection-album .card-info-subtitle-links,
.card-type-episode .card-info-subtitle-links {
text-align: center !important;
width: 100% !important;
}
.tracklist-station-container::after {
background: transparent !important;
}
.GlueHeader__background-overlay {
background: var(--modspotify_main_bg) !important;
}
/* Move navigation buttons and search field to the right and down */
.browser-navigation-top-bar {
margin-left: 40px !important;
margin-top: 15px !important;
}
.SearchInput__input,
.SearchInput__searchIcon,
.SearchInput__clearButton {
margin-top: 15px !important;
}
.content-top-bar__profile-menu-button {
margin-top: 15px !important;
}
.body-container--windows:not(.with-buddy-list):not(.messagebar) .content-top-bar__profile {
margin-right: 110px !important;
margin-top: -5px;
}
/* Spice up Fullscreen mode */
#view-player .album-art .album-art__image {
border-radius: 30px !important;
box-shadow: 0 10px 70px rgba(var(--modspotify_rgb_cover_overlay_and_shadow),.5) !important;
}
#view-player .album-art .album-art__image .card-image-content-wrapper,
#view-player .album-art .album-art__image .card-image-content-wrapper .card-image {
border-radius: 30px !important;
}
/* Daily mixes */
.carousel .card-info-wrapper.card-info-with-description.card-info-with-metadata {
height: 50px !important;
}
/* Remove section divider */
.section-divider {
border-bottom: 0 !important;
}
/* Adjust Position of border active tab in Nav bar at top
and add little glowing effect
*/
.nav.navbar-nav {
overflow: hidden !important;
}
.nav.navbar-nav a {
overflow: visible !important;
}
.nav.navbar-nav a::after {
bottom: 0px !important;
width: 100% !important;
}
.nav.navbar-nav .active a::after{
box-shadow: 0 0px 20px !important;
}
.nav.navbar-nav a:focus:not(.button):active::after{
background-color: var(--modspotify_pressing_fg) !important;
}
/* Notification bar */
#content-wrapper #view-message-bar {
position: absolute !important;
width: calc(100% - 160px) !important;
margin-left: 80px !important;
border-radius: 0 0 10px 10px !important;
}
/* Small cover Big cover mechanism */
.now-playing.cover-size-transition.active.image-expanded .cover-image {
width: 10px !important;
height: 10px !important;
}
.now-playing.cover-size-transition.active.image-expanded .caption {
padding-left: 0px !important;
}
#view-now-playing a.image {
overflow: visible !important;
}
#view-now-playing.expanded {
width: 200px;
height: 200px;
}
#now-playing-image-large .cover-image {
height: 200px !important;
}
/* Profile arrow in top left */
.content-top-bar__profile-menu-button .dropdown {
position: fixed !important;
top: 10px !important;
-webkit-app-region: no-drag !important;
}
body.body-container--windows .content-top-bar__profile-menu-button .dropdown {
right: 190px !important;
}
body:not(.body-container--windows) .content-top-bar__profile-menu-button .dropdown {
right: 20px !important;
}
/* Small tooltip */
#tooltip {
box-shadow: 0 0 10px rgba(0,0,0,0.2) !important;
border-radius: 5px !important;
border: 2px solid var(--modspotify_main_fg);
padding: 10px 10px;
}
.tooltip-arrow-top, .tooltip-arrow-bottom {
display: none !important;
}
.lyrics-lines-container,
.message-container {
color: #FFFFFF !important;
}
/* Home page */
.GlueCarousel__grid-wrapper::-webkit-scrollbar-thumb {
display: none;
}
.GlueCard__info-wrapper,
.Card__info-wrapper {
margin-bottom: 30px;
}
.card-horizontal-interior-wrapper .card-info-title {
text-align: start !important;
}
.tl-row.selected:hover .tl-cell {
background: var(--modspotify_scrollbar_fg_and_selected_row_bg) !important;
}
.GlueTableRow--is-selected {
background-color: var(--modspotify_scrollbar_fg_and_selected_row_bg) !important;
}
.tracklist-podcast .tl-progress .row-progress__bar {
background-color: var(--modspotify_main_fg);
}
.Header__background-color{
background-color: var(--modspotify_main_bg) !important;
}
.Button--style-green,
.button.button-green, .button.button-white {
border-radius: 4px;
color: var(--modspotify_main_bg) !important;
}
.glue-page-header:not(.glue-page-header--album):not(.glue-page-header--playlist):not(.glue-page-header--artist):not(.glue-page-header--dailymix):not(.glue-page-header--user):not(.glue-page-header--show)
.glue-page-header__content-inner .glue-page-header__title-text,
.HomeHeader .Header__content-inner .Header__title-text-inner,
.MadeForYouHeader .Header__content-inner .Header__title-text-inner,
.RecentlyPlayedPage__header .Header__content-inner .Header__title-text-inner {
background-color: var(--modspotify_main_bg);
padding: 5px 20px;
border: 5px solid var(--modspotify_main_fg) !important;
border-radius: 6px;
box-shadow: 0 4px 12px 0 rgba(var(--modspotify_rgb_cover_overlay_and_shadow),.2);
text-transform: uppercase;
}
.glue-page-header.glue-page-header--album .glue-page-header__content-inner .glue-page-header__title,
.glue-page-header.glue-page-header--artist .glue-page-header__content-inner .glue-page-header__title,
.glue-page-header.glue-page-header--dailymix .glue-page-header__content-inner .glue-page-header__title,
.glue-page-header.glue-page-header--playlist .glue-page-header__content-inner .glue-page-header__title {
margin-top: 10px;
}
span.glue-page-header__title-text {
color: var(--modspotify_main_fg);
}
.glue-page-header .glue-page-header__content-inner .glue-page-header__button {
margin-top: 40px;
}
.glue-page-header__content-inner,
.glue-page-header__data,
.glue-page-header__title,
.Header__content-inner,
.Header__data,
.Header__title,
.Header__title-text,
.Header__title-text-inner {
overflow: visible !important;
}
/*Force player bar to has fixed height*/
.view-player {
height: var(--bar-height) !important;
border-top: 0;
}
.view-player .now-playing {
overflow: unset;
}
.view-player .now-playing .cover-image-link,
.view-player .now-playing .cover-image-link figure {
width: var(--bar-height);
height: var(--bar-height);
}
#now-playing-image-small .cover-image {
position: fixed !important;
width: var(--bar-height);
height: var(--bar-height);
left: 0;
bottom: 0;
}
.view-player .now-playing .cover-image-link-wrapper {
flex: 0 1 calc(var(--bar-height) + 10px);
}
.text-container {
z-index: 3;
}
.view-player .now-playing-container .button-add {
color: var(--modspotify_main_fg) !important;
}
.progress-container .progress-bar,
.progress-container .inner {
top: 0 !important;
margin-top: 0 !important;
height: 5px;
}
.progress-container .progress-bar-wrapper {
top: 0 !important;
height: 5px;
}
.progress-container {
position: fixed !important;
width: 100% !important;
bottom: var(--bar-height) !important;
margin : 0 !important;
}
.progress-container .inner {
border-radius: 0 2px 2px 0 !important;
background-color: var(--modspotify_main_fg) !important;
box-shadow: 0 2px 2px 0 var(--modspotify_main_fg);
}
.glue-page-header__p2s-details,
.glue-page-header__p2s-followers {
display: none;
}
.context-menu {
border: 2px solid var(--modspotify_main_fg);
box-shadow: 0 4px 12px 0 rgba(var(--modspotify_rgb_cover_overlay_and_shadow),.2);
border-radius: 7px !important;
overflow: hidden;
}
#menu-wrapper ::-webkit-scrollbar {
display: none;
}
#menu-wrapper {
border-right: 3px solid black;
border-image: linear-gradient(0deg, transparent , var(--modspotify_scrollbar_fg_and_selected_row_bg) 40%, var(--modspotify_scrollbar_fg_and_selected_row_bg) 60%, transparent 90%) 2 90%;
}
.main-view-wrapper {
overflow: unset;
}
.Button--style-icon-stroke:after,
.Button--style-icon-stroke:hover:after,
.Button--style-icon-stroke,
.glue-page-header__button .button-icon-with-stroke,
.glue-page-header__button .button-icon-with-stroke::after {
box-shadow: unset;
}
.glue-page-header.glue-page-header--artist .glue-page-header__label {
padding-top: 10px;
}
.glue-page-header.glue-page-header--artist.has-custom-image .glue-page-header__label {
padding-top: 8px;
}
.glue-page-header__content .glue-page-header__label {
margin-left: -2px;
z-index: 2;
}
.glue-page-header__label span,
.Header__label span {
background-color: var(--modspotify_main_fg);
color: var(--modspotify_main_bg);
padding: 2px 10px;
}
.glue-page-header__label .header-verified-check {
background-color: transparent;
}
body.remotebar .view-player .player-bar-wrapper {
height: 100%;
}
.SidebarListItem--is-active:after,
.RootlistItem--is-active:after,
/* For Linux */ #view-navigation-bar .item.active:after {
background-color: transparent;
background-image: linear-gradient(90deg, var(--modspotify_sidebar_indicator_and_hover_button_bg) , transparent);
opacity: 0.2;
bottom: unset;
top: 5%;
height: 90%;
width: 100%
}
.Header__image-inner {
box-shadow: unset;
}

View File

@ -1,15 +1,17 @@
{ config, lib, pkgs, ... }:
with config.deviceSpecific;
with config.lib.base16.theme;
let
thm = config.lib.base16.theme;
in
{
home-manager.users.alukard = {
programs.urxvt = {
enable = isLaptop;
enable = config.deviceSpecific.isLaptop;
extraConfig = {
"font" = "xft:${powerlineFont}:style=Regular:size=${smallFontSize}";
"boldFont" = "xft:${powerlineFont}:style=Bold:size=${smallFontSize}";
"italicFont" = "xft:${powerlineFont}:style=Italic:size=${smallFontSize}";
"boldItalicfont" = "xft:${powerlineFont}:style=Bold Italic:size=${smallFontSize}";
"font" = "xft:${thm.powerlineFont}:style=Regular:size=${thm.smallFontSize}";
"boldFont" = "xft:${thm.powerlineFont}:style=Bold:size=${thm.smallFontSize}";
"italicFont" = "xft:${thm.powerlineFont}:style=Italic:size=${thm.smallFontSize}";
"boldItalicfont" = "xft:${thm.powerlineFont}:style=Bold Italic:size=${thm.smallFontSize}";
"letterSpace" = "0";
"lineSpace" = "0";
@ -31,31 +33,31 @@ with config.lib.base16.theme;
"keysym.Control-Right" = "\\033[1;5C";
"keysym.Control-Left" = "\\033[1;5D";
"foreground" = "#${base05-hex}";
"background" = "#${base00-hex}";
"cursorColor" = "#${base05-hex}";
"color0" = "#${base00-hex}";
"color1" = "#${base08-hex}";
"color2" = "#${base0B-hex}";
"color3" = "#${base0A-hex}";
"color4" = "#${base0D-hex}";
"color5" = "#${base0E-hex}";
"color6" = "#${base0C-hex}";
"color7" = "#${base05-hex}";
"color8" = "#${base03-hex}";
"color9" = "#${base08-hex}";
"color10" = "#${base0B-hex}";
"color11" = "#${base0A-hex}";
"color12" = "#${base0D-hex}";
"color13" = "#${base0E-hex}";
"color14" = "#${base0C-hex}";
"color15" = "#${base07-hex}";
"color16" = "#${base09-hex}";
"color17" = "#${base0F-hex}";
"color18" = "#${base01-hex}";
"color19" = "#${base02-hex}";
"color20" = "#${base04-hex}";
"color21" = "#${base06-hex}";
"foreground" = "#${thm.base05-hex}";
"background" = "#${thm.base00-hex}";
"cursorColor" = "#${thm.base05-hex}";
"color0" = "#${thm.base00-hex}";
"color1" = "#${thm.base08-hex}";
"color2" = "#${thm.base0B-hex}";
"color3" = "#${thm.base0A-hex}";
"color4" = "#${thm.base0D-hex}";
"color5" = "#${thm.base0E-hex}";
"color6" = "#${thm.base0C-hex}";
"color7" = "#${thm.base05-hex}";
"color8" = "#${thm.base03-hex}";
"color9" = "#${thm.base08-hex}";
"color10" = "#${thm.base0B-hex}";
"color11" = "#${thm.base0A-hex}";
"color12" = "#${thm.base0D-hex}";
"color13" = "#${thm.base0E-hex}";
"color14" = "#${thm.base0C-hex}";
"color15" = "#${thm.base07-hex}";
"color16" = "#${thm.base09-hex}";
"color17" = "#${thm.base0F-hex}";
"color18" = "#${thm.base01-hex}";
"color19" = "#${thm.base02-hex}";
"color20" = "#${thm.base04-hex}";
"color21" = "#${thm.base06-hex}";
};
};
};

34
modules/boot.nix Normal file
View File

@ -0,0 +1,34 @@
{ lib, pkgs, config, ... }: {
boot = {
loader = {
systemd-boot.enable = lib.mkIf (pkgs.system == "x86_64-linux") true;
# efi.canTouchEfiVariables = true;
};
kernelPackages = if config.deviceSpecific.isVM then
pkgs.linuxPackages
else
pkgs.linuxPackages_latest;
supportedFilesystems = [ "ntfs" ];
blacklistedKernelModules = lib.mkIf (config.device == "Dell-Laptop") [
"psmouse"
];
initrd.kernelModules = if config.deviceSpecific.devInfo.gpu.vendor == "intel" then [ "iHD" ] else [ ];
# kernelParams = lib.mkIf (device == "Dell-Laptop") [
# "mem_sleep_default=deep"
# ];
extraModprobeConfig = lib.mkIf (config.device == "AMD-Workstation") ''
options snd slots=snd_virtuoso,snd_usb_audio
'';
consoleLogLevel = 3;
kernel.sysctl = {
"vm.swappiness" = if config.deviceSpecific.isSSD then 1 else 10;
};
};
}

View File

@ -1,45 +1,54 @@
device:
{ config, lib, ... }: {
imports = [
./applications/alacritty.nix
./applications/kitty.nix
./applications/mpv.nix
./applications/packages.nix
./applications/rofi.nix
./applications/urxvt.nix
./applications/vscode.nix
builtins.listToAttrs (builtins.map (path: {
name = builtins.head (let
b = builtins.baseNameOf path;
m = builtins.match "(.*)\\.nix" b;
in if isNull m then [ b ] else m);
value = import path;
}) [
./applications/alacritty.nix
./applications/kitty.nix
./applications/mpv.nix
./applications/packages.nix
./applications/rofi.nix
./applications/urxvt.nix
./applications/vscode.nix
# ./workspace/barrier.nix
./workspace/dunst.nix
./workspace/fonts.nix
./workspace/gtk.nix
./workspace/i3
./workspace/i3status-rust
./workspace/kde
./workspace/light.nix
./workspace/locale.nix
./workspace/misc.nix
./workspace/picom.nix
./workspace/pulseeffects
# ./workspace/spotifyd.nix
./workspace/ssh.nix
./workspace/xresources.nix
./workspace/zsh.nix
# ./workspace/barrier.nix
./workspace/cursor.nix
./workspace/dunst.nix
./workspace/fonts.nix
./workspace/git.nix
./workspace/gpg.nix
./workspace/gtk.nix
./workspace/i3
./workspace/i3status-rust
./workspace/kde
./workspace/light.nix
./workspace/locale.nix
./workspace/misc.nix
./workspace/picom.nix
./workspace/pulseeffects
# ./workspace/spotifyd.nix
./workspace/ssh.nix
./workspace/xresources.nix
./workspace/zsh.nix
./applications.nix
./devices.nix
./filesystems.nix
./hardware.nix
./network.nix
./packages.nix
./power.nix
./samba.nix
./secrets.nix
./services.nix
./sound
./themes.nix
./users.nix
./wireguard.nix
./xserver.nix
];
}
./applications.nix
./boot.nix
./devices.nix
./filesystems.nix
./hardware.nix
./network.nix
./nix.nix
./overlay.nix
./power.nix
./samba.nix
./secrets.nix
./security.nix
./services.nix
./sound
./themes.nix
./virtualisation.nix
./wireguard.nix
./xserver.nix
])

View File

@ -2,77 +2,139 @@
with lib;
with types; {
options = {
device = mkOption { type = strMatching "[A-z|0-9]*-(Laptop|Workstation|VM)"; };
devices = mkOption { type = attrs; };
deviceSpecific = mkOption { type = attrs; };
};
config = {
deviceSpecific = let
device = config.device;
devInfo = config.devices.${config.device};
in rec {
isLaptop = (!isNull (builtins.match ".*Laptop" device));
isVM = (!isNull (builtins.match ".*VM" device));
isHost = (device == "AMD-Workstation");
isShared = devInfo.isShared;
isSSD = devInfo.drive.type == "ssd";
smallScreen = (device == "Dell-Laptop");
cpu = devInfo.cpu.vendor;
video = devInfo.video;
ram = devInfo.ram;
enableVirtualisation = devInfo.enableVirtualisation;
isGaming = devInfo.gaming;
};
devices = {
AMD-Workstation = {
device = mkOption { type = str; };
deviceSpecific = {
devInfo = {
cpu = {
vendor = "amd";
clock = 3700;
threads = 12;
arch = mkOption { type = enum [ "x86_64" "aarch64" ]; };
vendor = mkOption { type = enum [ "amd" "intel" "broadcom" ]; };
clock = mkOption { type = int; };
cores = mkOption { type = int; };
};
drive = {
type = "ssd";
size = 250;
type = mkOption { type = enum [ "hdd" "ssd" ]; };
speed = mkOption { type = int; };
size = mkOption { type = int; };
};
gpu = {
vendor = mkOption { type = enum [ "amd" "nvidia" "intel" "vm" ]; };
};
ram = mkOption { type = int; };
legacy = mkOption { type = bool; default = false; };
bigScreen = mkOption {
type = bool;
default = true;
};
video = "amd";
ram = 16;
isShared = false;
enableVirtualisation = true;
gaming = true;
};
Dell-Laptop = {
cpu = {
vendor = "intel";
clock = 1600;
threads = 8;
};
drive = {
type = "ssd";
size = 250;
};
video = "intel";
ram = 16;
isShared = false;
enableVirtualisation = false;
gaming = true;
isLaptop = mkOption {
type = bool;
default =
!isNull (builtins.match ".*Laptop" config.networking.hostName);
};
NixOS-VM = {
cpu = {
vendor = "amd";
clock = 3700;
threads = 4;
};
drive = {
type = "ssd";
size = 20;
};
video = "virtualbox";
ram = 4;
isShared = false;
enableVirtualisation = false;
gaming = false;
isVM = mkOption {
type = bool;
default =
!isNull (builtins.match ".*VM" config.networking.hostName);
};
isHost = mkOption {
type = bool;
default = false;
};
isShared = mkOption {
type = bool;
default = false;
};
isGaming = mkOption {
type = bool;
default = false;
};
enableVirtualisation = mkOption {
type = bool;
default = config.deviceSpecific.isHost;
};
isSSD = mkOption {
type = bool;
default = config.deviceSpecific.devInfo.drive.type == "ssd";
};
};
};
}
# { pkgs, lib, config, ... }:
# with lib;
# with types; {
# options = {
# device = mkOption { type = strMatching "[A-z|0-9]*-(Laptop|Workstation|VM)"; };
# devices = mkOption { type = attrs; };
# deviceSpecific = mkOption { type = attrs; };
# };
# config = {
# deviceSpecific = let
# device = config.device;
# devInfo = config.devices.${config.device};
# in rec {
# isLaptop = (!isNull (builtins.match ".*Laptop" device));
# isVM = (!isNull (builtins.match ".*VM" device));
# isHost = (device == "AMD-Workstation");
# isShared = devInfo.isShared;
# isSSD = devInfo.drive.type == "ssd";
# smallScreen = (device == "Dell-Laptop");
# cpu = devInfo.cpu.vendor;
# gpu = devInfo.gpu;
# ram = devInfo.ram;
# enableVirtualisation = devInfo.enableVirtualisation;
# isGaming = devInfo.gaming;
# };
# devices = {
# AMD-Workstation = {
# cpu = {
# vendor = "amd";
# clock = 3700;
# threads = 12;
# };
# drive = {
# type = "ssd";
# size = 250;
# };
# gpu = "amd";
# ram = 16;
# isShared = false;
# enableVirtualisation = true;
# gaming = true;
# };
# Dell-Laptop = {
# cpu = {
# vendor = "intel";
# clock = 1600;
# threads = 8;
# };
# drive = {
# type = "ssd";
# size = 250;
# };
# gpu = "intel";
# ram = 16;
# isShared = false;
# enableVirtualisation = true;
# gaming = true;
# };
# NixOS-VM = {
# cpu = {
# vendor = "amd";
# clock = 3700;
# threads = 4;
# };
# drive = {
# type = "ssd";
# size = 20;
# };
# gpu = "virtualbox";
# ram = 4;
# isShared = false;
# enableVirtualisation = false;
# gaming = false;
# };
# };
# };
# }

View File

@ -1,26 +1,19 @@
{ pkgs, config, lib, ... }:
with rec {
inherit (config) device devices deviceSpecific;
};
with deviceSpecific; {
with config.deviceSpecific; {
hardware.cpu.${devices.${device}.cpu.vendor}.updateMicrocode = true; # Update microcode
hardware.enableRedistributableFirmware = true; # For some unfree drivers
hardware.cpu.${devInfo.cpu.vendor}.updateMicrocode = true;
hardware.enableRedistributableFirmware = true;
# Enable hardware video acceleration for Intel
nixpkgs.config.packageOverrides = pkgs: {
vaapiIntel = pkgs.vaapiIntel.override { enableHybridCodec = true; };
};
boot.initrd.kernelModules = if video == "intel" then [ "iHD" ] else [ ];
# boot.initrd.kernelModules = if video == "intel" then [ "i915" ] else [ ];
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
extraPackages = if video == "intel" then [
# pkgs.vaapiIntel
# pkgs.vaapiVdpau
# pkgs.libvdpau-va-gl
extraPackages = if devInfo.gpu.vendor == "intel" then [
pkgs.intel-media-driver
] else [ ];
};
@ -28,41 +21,8 @@ with deviceSpecific; {
GST_VAAPI_ALL_DRIVERS = "1";
LIBVA_DRIVER_NAME = "iHD";
};
# --- END ---
# hardware.bluetooth.enable = isLaptop;
boot.loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
boot.kernelPackages = if isVM then
pkgs.linuxPackages
environment.systemPackages = if devInfo.gpu.vendor == "amd" then
[ (pkgs.mesa.override { enableRadv = true; }) ]
else
pkgs.linuxPackages_latest;
boot.supportedFilesystems = [ "ntfs" ];
boot.blacklistedKernelModules = lib.mkIf (device == "Dell-Laptop") [
"psmouse"
];
# boot.kernelParams = lib.mkIf (device == "Dell-Laptop") [
# "mem_sleep_default=deep"
# ];
boot.extraModprobeConfig = lib.mkIf (device == "AMD-Workstation") ''
options snd slots=snd_virtuoso,snd_usb_audio
'';
# SSD Section
boot.kernel.sysctl = {
"vm.swappiness" = if isSSD then 1 else 10;
};
services.fstrim = {
enable = isSSD;
interval = "weekly";
};
services.fwupd.enable = (device == "Dell-Laptop");
services.udev.packages = [ pkgs.stlink ];
[ ];
}

29
modules/nix.nix Normal file
View File

@ -0,0 +1,29 @@
{ config, lib, pkgs, inputs, ... }: {
nix = rec {
nixPath = lib.mkForce [ "nixpkgs=/etc/nixpkgs" ];
binaryCaches = [ "https://cache.nixos.org" ];
registry.self.flake = inputs.self;
trustedUsers = [ "root" "alukard" "@wheel" ];
# nrBuildUsers = 16;
# optimise.automatic = lib.mkIf (config.device != "Dell-Laptop") true;
optimise.automatic = true;
# autoOptimiseStore = config.deviceSpecific.isSSD;
autoOptimiseStore = false;
package = pkgs.nixFlakes;
# package = inputs.nix.packages.x86_64-linux.nix;
extraOptions = ''
experimental-features = nix-command flakes
'';
requireSignedBinaryCaches = false;
};
environment.etc.nixpkgs.source = inputs.nixpkgs;
}

View File

@ -9,13 +9,8 @@ let
in
{
nixpkgs.overlays = [
# inputs.nix.overlay
# mozilla_overlay
(self: super:
rec {
# nix = super.nix // {
# meta = super.nix.meta // { platforms = lib.platforms.unix; };
# };
inherit inputs;
youtube-to-mpv = pkgs.callPackage ./packages/youtube-to-mpv.nix { term = config.defaultApplications.term.cmd; };
@ -26,6 +21,12 @@ in
nomino = pkgs.callPackage ./packages/nomino.nix { };
bpytop = pkgs.callPackage ./packages/bpytop.nix { };
ibm-plex-powerline = pkgs.callPackage ./packages/ibm-plex-powerline.nix { };
bibata-cursors = pkgs.callPackage ./packages/bibata-cursors.nix { };
# nix-prefetch-github = old.nix-prefetch-github;
# utillinux = old.utillinux;
# cifs-utils = old.cifs-utils;
# mount = old.mount;
# vivaldi = old.vivaldi;
# material-icons = pkgs.callPackage ./packages/material-icons-inline.nix { };
# rust-stable = pkgs.latest.rustChannels.stable.rust.override {
@ -55,29 +56,4 @@ in
allowUnfree = true;
android_sdk.accept_license = true;
};
environment.etc.nixpkgs.source = inputs.nixpkgs;
nix = rec {
useSandbox = true;
autoOptimiseStore = config.deviceSpecific.isSSD;
optimise.automatic = true;
nixPath = lib.mkForce [
"nixpkgs=/etc/nixpkgs"
"nixos-config=/etc/nixos/configuration.nix"
];
extraOptions = ''
experimental-features = nix-command flakes
'';
# TODO: change?
package = pkgs.nixFlakes;
# package = inputs.nix.packages.x86_64-linux.nix;
registry.self.flake = inputs.self;
};
}

View File

@ -1,4 +1,4 @@
{ stdenv, python3Packages, fetchFromGitHub }:
{ stdenv, python3Packages, fetchFromGitHub, pkgs }:
python3Packages.buildPythonApplication rec {
name = "advance-touch";
@ -12,10 +12,10 @@ python3Packages.buildPythonApplication rec {
propagatedBuildInputs = with python3Packages; [ click ];
meta = {
meta = with pkgs.lib; {
homepage = "https://github.com/tanrax/terminal-AdvancedNewFile";
description = "Add to your terminal the option to quickly create folders and files like a pro";
license = stdenv.lib.licenses.unlicense;
maintainers = with stdenv.lib.maintainers; [ alukardbf ];
license = licenses.unlicense;
maintainers = with maintainers; [ alukardbf ];
};
}

View File

@ -0,0 +1,28 @@
{ lib, stdenv, fetchurl }:
stdenv.mkDerivation rec {
pname = "bibata-cursors";
version = "1.0.3";
src = fetchurl {
url = "https://github.com/ful1e5/Bibata_Cursor/releases/download/v${version}/Bibata.tar.gz";
sha256 = "1kywj7lvpg3d4dydh2d55gcggpwjcafvm87rqc0wsj1w0p7gy10b";
};
phases = [
"installPhase"
];
installPhase = ''
mkdir -p "$out/share/icons"
tar -xf $src --directory "$out/share/icons/"
'';
meta = with lib; {
description = "Material Based Cursor";
homepage = "https://github.com/ful1e5/Bibata_Cursor";
license = licenses.gpl3;
platforms = platforms.linux;
maintainers = with maintainers; [ ];
};
}

View File

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, python3Packages }:
{ stdenv, fetchFromGitHub, python3Packages, pkgs }:
stdenv.mkDerivation rec {
name = "bpytop";
version = "1.0.7";
@ -21,10 +21,10 @@ stdenv.mkDerivation rec {
chmod 755 "$out/bin/bpytop"
'';
meta = {
meta = with pkgs.lib; {
homepage = "https://github.com/aristocratos/bpytop";
description = "Resource monitor that shows usage and stats for processor, memory, disks, network and processes.";
license = stdenv.lib.licenses.asl20;
maintainers = with stdenv.lib.maintainers; [ alukardbf ];
license = licenses.asl20;
maintainers = with maintainers; [ alukardbf ];
};
}

View File

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, i3lock, xorg, inputs }:
{ stdenv, fetchFromGitHub, i3lock, xorg, inputs, pkgs }:
stdenv.mkDerivation rec {
name = "i3lock-fancy-rapid";
src = inputs.i3lock-fancy-rapid;
@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
cp i3lock-fancy-rapid $out/bin/i3lock-fancy-rapid
'';
meta = with stdenv.lib; {
meta = with pkgs.lib; {
description = "A faster implementation of i3lock-fancy. It is blazing fast and provides a fully configurable box blur. It uses linear-time box blur and accelerates using OpenMP.";
homepage = https://github.com/yvbbrjdr/i3lock-fancy-rapid;
maintainers = with maintainers; [ ];

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl }:
{ stdenv, fetchurl, pkgs }:
let
icons = "https://gist.github.com/draoncc/3c20d8d4262892ccd2e227eefeafa8ef/raw/3e6e12c213fba1ec28aaa26430c3606874754c30/MaterialIcons-Regular-for-inline.ttf";
in stdenv.mkDerivation {
@ -17,7 +17,7 @@ in stdenv.mkDerivation {
cp $src $out/share/fonts/truetype/MaterialIcons-Regular-for-inline.ttf
'';
meta = with stdenv.lib; {
meta = with pkgs.lib; {
description = "Material Icons Font patched for inline";
};
}

View File

@ -1,23 +1,47 @@
{ stdenv, fetchFromGitHub, rustPlatform, cmake, pkgconfig }:
# { stdenv, fetchFromGitHub, rustPlatform, cmake, pkgconfig, pkgs }:
with rustPlatform;
# with rustPlatform;
buildRustPackage rec {
# buildRustPackage rec {
# pname = "nomino";
# version = "0.4.2";
# cargoSha256 = "sha256-9p/HD16yreWdjbCaUaan07fnVpPwOCiHaVemfXP6L8c=";
# src = fetchFromGitHub {
# owner = "yaa110";
# repo = "nomino";
# rev = "8f437051ea51d333aa685679f0e5902d6709d7ef";
# sha256 = "1qmy73gmmf0i9svzrw2jz7nlypfybyd1izwd1a13fgm9dn7amja3";
# };
# nativeBuildInputs = [ cmake pkgconfig ];
# meta = with pkgs.lib; {
# description = "Batch rename utility for developers";
# homepage = "https://github.com/yaa110/nomino";
# license = licenses.mit;
# maintainers = with maintainers; [ alukardbf ];
# };
# }
{ stdenv, lib, fetchurl }:
stdenv.mkDerivation {
pname = "nomino";
version = "0.4.2";
version = "0.4.5";
cargoSha256 = "sha256-9p/HD16yreWdjbCaUaan07fnVpPwOCiHaVemfXP6L8c=";
src = fetchFromGitHub {
owner = "yaa110";
repo = "nomino";
rev = "8f437051ea51d333aa685679f0e5902d6709d7ef";
sha256 = "1qmy73gmmf0i9svzrw2jz7nlypfybyd1izwd1a13fgm9dn7amja3";
src = fetchurl {
url = "https://github.com/yaa110/nomino/releases/download/0.4.5/nomino-linux-64bit";
sha256 = "03ymw74xprgxwxizlpcd5fbhv6zc7avjqw881lm74xsn3ax4m3b8";
};
nativeBuildInputs = [ cmake pkgconfig ];
phases = [ "installPhase" ];
meta = with stdenv.lib; {
installPhase = ''
mkdir -p $out/bin
cp $src $out/bin/nomino
'';
meta = with lib; {
description = "Batch rename utility for developers";
homepage = "https://github.com/yaa110/nomino";
license = licenses.mit;

View File

@ -1,9 +1,6 @@
{ config, pkgs, lib, ... }:
with rec {
inherit (config) device deviceSpecific;
};
with deviceSpecific; {
with config.deviceSpecific; {
services.tlp = {
enable = isLaptop;
settings = {
@ -25,7 +22,7 @@ with deviceSpecific; {
};
};
services.undervolt = lib.mkIf (device == "Dell-Laptop") {
services.undervolt = lib.mkIf (config.device == "Dell-Laptop") {
enable = true;
coreOffset = -120;
gpuOffset = -54;

View File

@ -1,6 +1,6 @@
{ config, lib, pkgs, ... }:
with config.deviceSpecific;
{
with config.deviceSpecific; {
users.groups.smbgrp.gid = 2001;
# TODO: add nologin shell to this user
users.users.smbuser =

View File

@ -19,10 +19,12 @@ with config.deviceSpecific; {
"adbusers"
"input"
"libvirtd"
"kvm"
"vboxusers"
"smbgrp"
"cdrom"
"scanner"
"lp"
];
description = "Дмитрий Холкин";
uid = 1000;
@ -40,7 +42,7 @@ with config.deviceSpecific; {
# nix.requireSignedBinaryCaches = false;
home-manager.useUserPackages = true;
systemd.services."user@" = { serviceConfig = { Restart = "always"; }; };
services.mingetty.autologinUser = "alukard";
services.getty.autologinUser = "alukard";
# auto-login without greeters
# environment.loginShellInit = ''

View File

@ -10,7 +10,7 @@ with config.deviceSpecific; {
};
services.earlyoom = {
enable = ram < 16;
enable = devInfo.ram < 16;
freeMemThreshold = 5;
freeSwapThreshold = 100;
};
@ -28,14 +28,21 @@ with config.deviceSpecific; {
enable = true;
drivers = [ pkgs.samsungUnifiedLinuxDriver pkgs.gutenprint ];
};
hardware.sane.enable = true;
services.saned.enable = true;
services.fstrim = {
enable = isSSD;
interval = "weekly";
};
programs.dconf.enable = true;
services.fwupd.enable = (config.device == "Dell-Laptop");
services.udev.packages = [ pkgs.stlink ];
services.avahi = {
enable = true;
# ipv6 = true;
nssmdns = true;
publish = {
enable = true;
@ -47,28 +54,4 @@ with config.deviceSpecific; {
systemd.services.systemd-udev-settle.enable = false;
services.upower.enable = true;
virtualisation.docker.enable = enableVirtualisation;
environment.systemPackages = lib.mkIf (enableVirtualisation) [ pkgs.docker-compose ];
virtualisation.libvirtd = {
enable = enableVirtualisation;
};
# virtualisation.anbox.enable = isGaming; # broken
# virtualisation.virtualbox.host = {
# enable = device.enableVirtualisation;
# # enableHardening = false;
# enableExtensionPack = false;
# };
# Install cdemu for some gaming purposes
# programs.cdemu = {
# enable = true;
# image-analyzer = false;
# gui = false;
# group = "cdrom";
# };
}

View File

@ -57,7 +57,8 @@ with lib;
microFontSize = "10";
minimalFontSize = "8";
iconsTheme = "Papirus-Dark";
iconTheme = "Papirus-Dark";
# iconPkg = pkgs.papirus-icon-theme;
};
};
}

View File

@ -0,0 +1,23 @@
{ config, lib, pkgs, ... }: {
# virtualisation.docker.enable = enableVirtualisation;
# environment.systemPackages = lib.mkIf (enableVirtualisation) [ pkgs.docker-compose ];
virtualisation.libvirtd = {
enable = config.deviceSpecific.enableVirtualisation;
qemuOvmf = true;
qemuRunAsRoot = true;
onBoot = "ignore";
onShutdown = "shutdown";
qemuPackage = pkgs.qemu;
};
virtualisation.spiceUSBRedirection.enable = config.deviceSpecific.enableVirtualisation;
# virtualisation.anbox.enable = isGaming; # broken
# virtualisation.virtualbox.host = {
# enable = false;
# # enableHardening = false;
# enableExtensionPack = false;
# };
}

View File

@ -0,0 +1,16 @@
{ pkgs, lib, ... }: {
environment.sessionVariables = {
XCURSOR_PATH = lib.mkForce "/home/alukard/.icons";
};
home-manager.users.alukard = {
xsession.pointerCursor = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Classic";
};
home.file.".icons/default" = {
source = "${pkgs.bibata-cursors}/share/icons/Bibata-Modern-Classic";
};
};
}

View File

@ -6,7 +6,7 @@ in {
services.dunst = {
enable = true;
iconTheme = {
name = "${thm.iconsTheme}";
name = "${thm.iconTheme}";
package = pkgs.papirus-icon-theme;
};
settings = {

View File

@ -19,7 +19,7 @@ in
# material-design-icons
];
fontconfig = {
enable = true;
enable = lib.mkForce true;
defaultFonts = {
monospace = [ "${thm.fontMono} ${thm.normalFontSize}" ];
sansSerif = [ "${thm.font} ${thm.normalFontSize}" ];

18
modules/workspace/git.nix Normal file
View File

@ -0,0 +1,18 @@
{
home-manager.users.alukard = {
programs.git = {
enable = true;
userEmail = "alukard.develop@gmail.com";
userName = "Dmitriy Kholkin";
signing = {
signByDefault = true;
key = "922DA6E758A0FE4CFAB4E4B2FD266B810DF48DF2";
};
extraConfig = {
core = {
editor = "code --wait";
};
};
};
};
}

11
modules/workspace/gpg.nix Normal file
View File

@ -0,0 +1,11 @@
{
home-manager.users.alukard = {
programs.gpg.enable = true;
services.gpg-agent = {
enable = true;
enableSshSupport = true;
pinentryFlavor = "gnome3";
sshKeys = [ "E6A6377C3D0827C36428A290199FDB3B91414AFE" ];
};
};
}

View File

@ -26,29 +26,32 @@ let
'';
};
in {
nixpkgs.overlays = [(self: super: {
generated-gtk-theme = self.stdenv.mkDerivation rec {
name = "generated-gtk-theme";
src = inputs.materia-theme;
buildInputs = with self; [ sassc bc which inkscape optipng ];
installPhase = ''
HOME=/build
chmod 777 -R .
patchShebangs .
mkdir -p $out/share/themes
substituteInPlace change_color.sh --replace "\$HOME/.themes" "$out/share/themes"
echo "Changing colours:"
./change_color.sh -o Generated ${materia_colors}
chmod 555 -R .
'';
};
})];
nixpkgs.overlays = [
(self: super: {
generated-gtk-theme = self.stdenv.mkDerivation rec {
name = "generated-gtk-theme";
src = inputs.materia-theme;
buildInputs = with self; [ sassc bc which inkscape optipng ];
installPhase = ''
HOME=/build
chmod 777 -R .
patchShebangs .
mkdir -p $out/share/themes
substituteInPlace change_color.sh --replace "\$HOME/.themes" "$out/share/themes"
echo "Changing colours:"
./change_color.sh -o Generated ${materia_colors}
chmod 555 -R .
'';
};
})
];
programs.dconf.enable = true;
services.dbus.packages = with pkgs; [ gnome3.dconf ];
home-manager.users.alukard = {
gtk = {
enable = true;
iconTheme = {
name = "${thm.iconsTheme}";
name = "${thm.iconTheme}";
package = pkgs.papirus-icon-theme;
};
theme = {
@ -58,12 +61,18 @@ in {
font = {
name = "${thm.font} ${thm.normalFontSize}";
};
gtk3.extraConfig.gtk-cursor-theme-name = "bibata_oil";
gtk3 = {
extraConfig = {
gtk-cursor-theme-name = "Bibata-Modern-Classic";
};
};
};
home.sessionVariables.GTK_THEME = "Generated";
home.sessionVariables.XDG_DATA_DIRS = [
"${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}"
"${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}"
];
};
environment.sessionVariables.XDG_CURRENT_DESKTOP = "X-Generic";
}

View File

@ -83,8 +83,8 @@ in {
];
};
startup = map (a: { notification = false; } // a) [
{ command = "${pkgs.feh}/bin/feh --bg-fill $HOME/.wallpaper"; }
# { command = "${pkgs.xorg.xrdb}/bin/xrdb -merge ~/.Xresources"; }
{ command = "${pkgs.feh}/bin/feh --bg-fill $HOME/nixos-config/misc/wallpaper"; }
{ command = "${pkgs.xorg.xrdb}/bin/xrdb -merge ~/.Xresources"; }
{ command = "${pkgs.tdesktop}/bin/telegram-desktop"; }
{
command =

View File

@ -1,8 +1,4 @@
{ pkgs, config, lib, ... }:
with rec {
inherit (config) device deviceSpecific;
};
with deviceSpecific;
let
scripts = import ./scripts pkgs config;
thm = config.lib.base16.theme;
@ -122,13 +118,13 @@ in {
[[block]]
block = "net"
''
(if device == "Dell-Laptop" then ''
(if config.device == "Dell-Laptop" then ''
device = "wlo1"
'' else "")
(if device == "AMD-Workstation" then ''
(if config.device == "AMD-Workstation" then ''
device = "enp9s0"
'' else "")
(if isLaptop then ''
(if config.deviceSpecific.isLaptop then ''
[[block]]
block = "battery"
interval = 10

View File

@ -4,25 +4,9 @@ let
in
{
# xdg.portal.enable = true;
# xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-kde ];
# services.dbus.packages = [
# pkgs.plasma5.xdg-desktop-portal-kde
# pkgs.flatpak
# pkgs.firefox
# pkgs.systemd
# pkgs.papirus-icon-theme
# pkgs.kdeApplications.kdegraphics-thumbnailers
# pkgs.kdeFrameworks.baloo
# pkgs.kdeFrameworks.kio
# pkgs.kdeApplications.kio-extras
# pkgs.kdeApplications.dolphin-plugins
# ];
# environment.systemPackages = [
# pkgs.kdeFrameworks.baloo
# pkgs.kdeFrameworks.kio
# pkgs.kdeApplications.kio-extras
# pkgs.kdeApplications.kdegraphics-thumbnailers
# pkgs.kdeApplications.dolphin-plugins
# ];
# services.udev.packages = [
# pkgs.libmtp
@ -33,7 +17,6 @@ in
# DESKTOP_SESSION = "kde";
QT_XFT = "true";
QT_SELECT = "5";
# XDG_CURRENT_DESKTOP = "KDE";
KDE_SESSION_VERSION = "5";
QT_SCALE_FACTOR = "1";
QT_AUTO_SCREEN_SCALE_FACTOR = "0";
@ -147,6 +130,6 @@ in
contrast = 4;
widgetStyle = "Breeze";
};
Icons = { Theme = "${thm.iconsTheme}"; };
Icons = { Theme = "${thm.iconTheme}"; };
};
}

View File

@ -1,9 +1,8 @@
{ config, pkgs, lib, ... }:
with config.deviceSpecific;
{
programs.light.enable = isLaptop;
programs.light.enable = config.deviceSpecific.isLaptop;
services.actkbd = {
enable = isLaptop;
enable = config.deviceSpecific.isLaptop;
bindings = map (x:
x // {
events = ["key"];

View File

@ -11,7 +11,7 @@
LANG = lib.mkForce "en_GB.UTF-8";
};
time.timeZone = "Europe/Volgograd";
time.timeZone = "Europe/Moscow";
location = {
provider = "manual";
@ -19,14 +19,16 @@
longitude = 44.77973;
};
home-manager.users.alukard.home.language = let
en = "en_GB.UTF-8";
ru = "ru_RU.UTF-8";
in {
address = ru;
monetary = ru;
paper = ru;
time = en;
base = en;
home-manager.users.alukard = {
home.language = let
en = "en_GB.UTF-8";
ru = "ru_RU.UTF-8";
in {
address = ru;
monetary = ru;
paper = ru;
time = en;
base = en;
};
};
}

View File

@ -1,42 +1,20 @@
{ pkgs, lib, config, ... }: {
environment.sessionVariables = {
EDITOR = config.defaultApplications.editor.cmd;
VISUAL = config.defaultApplications.editor.cmd;
LESS = "-asrRix8";
environment.sessionVariables = config.home-manager.users.alukard.home.sessionVariables // {
NIX_AUTO_RUN = "1";
} // config.home-manager.users.alukard.home.sessionVariables;
services.atd.enable = true;
};
home-manager.users.alukard = {
xdg.enable = true;
home.activation."mimeapps-remove" = {
before = [ "linkGeneration" ];
after = [ ];
data = "rm -f /home/alukard/.config/mimeapps.list";
};
services.udiskie.enable = true;
programs.git = {
enable = true;
userEmail = "alukard.develop@gmail.com";
userName = "Dmitriy Kholkin";
signing = {
signByDefault = true;
key = "922DA6E758A0FE4CFAB4E4B2FD266B810DF48DF2";
};
extraConfig = {
core = {
editor = "code --wait";
};
};
};
programs.gpg.enable = true;
services.gpg-agent = {
enable = true;
enableSshSupport = true;
pinentryFlavor = "gnome3";
sshKeys = [ "E6A6377C3D0827C36428A290199FDB3B91414AFE" ];
};
programs.direnv = {
enable = true;
enableZshIntegration = true;
@ -52,15 +30,10 @@
news.display = "silent";
home.keyboard = {
options = [ "grp:win_space_toogle" ];
layout = "us,ru";
};
home.file.".icons/default" = {
source = "${pkgs.bibata-cursors}/share/icons/Bibata_Oil";
};
systemd.user.startServices = true;
};
home-manager.users.alukard.home.stateVersion = "20.09";
system.stateVersion = "20.03";
}

View File

@ -115,7 +115,7 @@
"slope": "x1",
"solo": "false",
"mute": "false",
"gain": "6",
"gain": "8",
"frequency": "23",
"q": "1.13"
},
@ -125,7 +125,7 @@
"slope": "x1",
"solo": "false",
"mute": "false",
"gain": "4",
"gain": "6",
"frequency": "45",
"q": "1.51"
},
@ -135,7 +135,7 @@
"slope": "x1",
"solo": "false",
"mute": "false",
"gain": "3",
"gain": "5",
"frequency": "63",
"q": "1.88"
},
@ -217,7 +217,7 @@
"slope": "x1",
"solo": "false",
"mute": "false",
"gain": "6",
"gain": "8",
"frequency": "23",
"q": "1.13"
},
@ -227,7 +227,7 @@
"slope": "x1",
"solo": "false",
"mute": "false",
"gain": "4",
"gain": "6",
"frequency": "45",
"q": "1.51"
},
@ -237,7 +237,7 @@
"slope": "x1",
"solo": "false",
"mute": "false",
"gain": "3",
"gain": "5",
"frequency": "63",
"q": "1.88"
},
@ -348,7 +348,7 @@
},
"limiter": {
"state": "true",
"input-gain": "-7",
"input-gain": "-10",
"limit": "0",
"lookahead": "5",
"release": "50",

View File

@ -2,28 +2,31 @@
let
thm = config.lib.base16.theme;
in
with rec {
inherit (config) deviceSpecific;
};
with deviceSpecific; {
with config.deviceSpecific; {
services.xserver = {
enable = true;
# TODO: Disable natural scrolling for external mouse
libinput = {
enable = isLaptop;
# sendEventsMode = "disabled-on-external-mouse";
middleEmulation = true;
accelProfile = lib.mkIf (!isLaptop) "flat";
naturalScrolling = true;
enable = true;
mouse = {
accelProfile = "flat";
middleEmulation = false;
naturalScrolling = false;
};
touchpad = lib.mkIf isLaptop {
accelProfile = "adaptive";
middleEmulation = true;
naturalScrolling = true;
};
};
# TODO: make settings for laptops with dGPU
videoDrivers = if video == "amd" then
videoDrivers = if devInfo.gpu.vendor == "amd" then
[ "amdgpu" ]
else if video == "nvidia" then
else if devInfo.gpu.vendor == "nvidia" then
[ "nvidia" ]
else if video == "intel" then
else if devInfo.gpu.vendor == "intel" then
[ "intel" ]
else
[ ];
@ -71,9 +74,4 @@ with deviceSpecific; {
layout = "us,ru";
xkbOptions = "grp:win_space_toggle";
};
environment.systemPackages = if video == "amd" then
[ (pkgs.mesa.override { enableRadv = true; }) ]
else
[ ];
}

19
profiles/base.nix Normal file
View File

@ -0,0 +1,19 @@
{ inputs, ... }: {
imports = with inputs.self.nixosModules; [
inputs.home-manager.nixosModules.home-manager
boot
devices
git
gpg
locale
misc
network
nix
overlay
secrets
security
ssh
zsh
];
}

5
profiles/default.nix Normal file
View File

@ -0,0 +1,5 @@
{
server = ./server.nix;
desktop = ./desktop.nix;
base = ./base.nix;
}

38
profiles/desktop.nix Normal file
View File

@ -0,0 +1,38 @@
{ inputs, ... }: {
imports = with inputs.self.nixosModules; [
./base.nix
inputs.base16.hmModule
applications
filesystems
hardware
power
samba
services
sound
themes
virtualisation
wireguard
xserver
alacritty
kitty
mpv
packages
rofi
urxvt
vscode
cursor
dunst
fonts
gtk
i3
i3status-rust
kde
light
picom
pulseeffects
xresources
];
}

5
profiles/server.nix Normal file
View File

@ -0,0 +1,5 @@
{ inputs, ... }: {
imports = [
./base.nix
];
}