Compare commits

...

10 Commits

Author SHA1 Message Date
5e6db2d595 feat: Remove nethack from packages, it will be installed by module 2024-08-06 17:35:49 +03:00
be0c828219 feat(flake, home): Add plasma component using plasma-manager 2024-08-06 15:56:59 +03:00
93a6ef8c15 chore: Update flake inputs 2024-08-06 13:53:04 +03:00
c3327f0152 feat(home): Add neovim keymaps, improve readability 2024-08-06 12:09:59 +03:00
f5b01e9f8f refactor(system, home): Move mpv [./system -> ./home], add git to ./system 2024-08-06 02:28:20 +03:00
668c2f17c4 refactor(flake, system): improve code structure
Refactor configuration generation

- Inherit lib from nixpkgs
- Rename functions (mkHome -> makeHome, merge -> forEachHost
- Relocate some variables' definitions into config generator functions
- Create separate function to track home-manager modules
2024-08-06 01:59:04 +03:00
2f0934d02b Removed "# vim: ts=2 sw=2 et" from all files 2024-08-05 01:59:45 +03:00
b4f1f0401d Changed neovim colorscheme to nightfox/nordfox 2024-08-05 01:59:05 +03:00
299528e840 Moved common stuff into ./home/common.nix 2024-08-05 01:35:00 +03:00
9d7e4d18be Moved firefox config into ./home/components and included it into ./home/common.nix 2024-08-05 00:43:16 +03:00
11 changed files with 419 additions and 285 deletions

87
flake.lock generated
View File

@@ -91,11 +91,11 @@
]
},
"locked": {
"lastModified": 1721042469,
"narHash": "sha256-6FPUl7HVtvRHCCBQne7Ylp4p+dpP3P/OYuzjztZ4s70=",
"lastModified": 1722857853,
"narHash": "sha256-3Zx53oz/MSIyevuWO/SumxABkrIvojnB7g9cimxkhiE=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "f451c19376071a90d8c58ab1a953c6e9840527fd",
"rev": "06939f6b7ec4d4f465bf3132a05367cccbbf64da",
"type": "github"
},
"original": {
@@ -133,11 +133,11 @@
]
},
"locked": {
"lastModified": 1722630065,
"narHash": "sha256-QfM/9BMRkCmgWzrPDK+KbgJOUlSJnfX4OvsUupEUZvA=",
"lastModified": 1722936497,
"narHash": "sha256-UBst8PkhY0kqTgdKiR8MtTBt4c1XmjJoOV11efjsC/o=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "afc892db74d65042031a093adb6010c4c3378422",
"rev": "a6c743980e23f4cef6c2a377f9ffab506568413a",
"type": "github"
},
"original": {
@@ -167,12 +167,33 @@
"type": "github"
}
},
"home-manager_3": {
"inputs": {
"nixpkgs": [
"plasma-manager",
"nixpkgs"
]
},
"locked": {
"lastModified": 1714377222,
"narHash": "sha256-UsDsjWCKlWn8vbXi8Zza9Hkq3xyk8fpvFNo2VM5S74E=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "2af7c78b7bb9cf18406a193eba13ef9f99388f49",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nethack": {
"locked": {
"lastModified": 1722805676,
"narHash": "sha256-6xrP2Laaga31DrZVQhmn7+XN+w64YZzPxhHxX2zOGXM=",
"lastModified": 1722954623,
"narHash": "sha256-DqxAJn0qsxm0gR86PccgmdZJZULvmgbqIoTGeSuJ8w8=",
"ref": "refs/heads/master",
"rev": "56ff4000d9521d4782fa83854c39f8a518ca4ddf",
"rev": "8f8ed82ac1d4c7b0914935a21a8027bdae70669f",
"shallow": true,
"type": "git",
"url": "https://git.psf.lt/xezo360hye/nethack"
@@ -191,11 +212,11 @@
]
},
"locked": {
"lastModified": 1722609272,
"narHash": "sha256-Kkb+ULEHVmk07AX+OhwyofFxBDpw+2WvsXguUS2m6e4=",
"lastModified": 1722924007,
"narHash": "sha256-+CQDamNwqO33REJLft8c26NbUi2Td083hq6SvAm2xkU=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "f7142b8024d6b70c66fd646e1d099d3aa5bfec49",
"rev": "91010a5613ffd7ee23ee9263213157a1c422b705",
"type": "github"
},
"original": {
@@ -206,11 +227,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1722630782,
"narHash": "sha256-hMyG9/WlUi0Ho9VkRrrez7SeNlDzLxalm9FwY7n/Noo=",
"lastModified": 1722813957,
"narHash": "sha256-IAoYyYnED7P8zrBFMnmp7ydaJfwTnwcnqxUElC1I26Y=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "d04953086551086b44b6f3c6b7eeb26294f207da",
"rev": "cb9a96f23c491c081b38eab96d22fa958043c9fa",
"type": "github"
},
"original": {
@@ -235,11 +256,11 @@
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1722763580,
"narHash": "sha256-LgYIYkNYzqCldWJ/xJRQ156WDp6P9hHb4EsIXsRa+u4=",
"lastModified": 1722925425,
"narHash": "sha256-BXUYNBaG5KF+h8aU7p/4HUxGK1G42Ji/GK+KkC3bntU=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "6f7cf23b226ceaee0a2d479c505652065dfe526f",
"rev": "e48ce785d9e72c0106319d93e23c5579336ffe33",
"type": "github"
},
"original": {
@@ -257,11 +278,11 @@
]
},
"locked": {
"lastModified": 1722493084,
"narHash": "sha256-ktjl908zZKWcGdMyz6kX1kHSg7LFFGPYBvTi9FgQleM=",
"lastModified": 1722772237,
"narHash": "sha256-3eCYmzeLngX8eutIsTZAG8DIvT/0DWQQxiszTQz8n0s=",
"owner": "NuschtOS",
"repo": "search",
"rev": "3f5abffa5f28b4ac3c9212c81c5e8d2d22876071",
"rev": "aa5f6246565cc9b1e697d2c9d6ed2c842b17fff6",
"type": "github"
},
"original": {
@@ -270,12 +291,34 @@
"type": "github"
}
},
"plasma-manager": {
"inputs": {
"home-manager": "home-manager_3",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1722804745,
"narHash": "sha256-l6N3QaiDqN2QmHDAxjczQPLPCTv+Kp7PsrtJBltmhTo=",
"owner": "nix-community",
"repo": "plasma-manager",
"rev": "61d9342fb471cd3c45a047406428fba7b6fb49ad",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "plasma-manager",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nethack": "nethack",
"nixpkgs": "nixpkgs",
"nixvim": "nixvim"
"nixvim": "nixvim",
"plasma-manager": "plasma-manager"
}
},
"systems": {

View File

@@ -14,52 +14,61 @@
inputs.nixpkgs.follows = "nixpkgs";
};
nethack = {
url = git+https://git.psf.lt/xezo360hye/nethack?shallow=1;
#url = git+ssh://git@git.psf.lt/xezo360hye/nethack?shallow=1;
#url = path:/home/andrey/nethack;
plasma-manager = {
url = github:nix-community/plasma-manager;
inputs.nixpkgs.follows = "nixpkgs";
};
# nixpkgs-2405.url = github:nixos/nixpkgs/nixos-24.05;
# hm-2405.url = github:nix-community/home-manager/release-24.05;
nethack = {
url = git+https://git.psf.lt/xezo360hye/nethack?shallow=1;
};
};
outputs = { self, nixpkgs, home-manager, nixvim, nethack, ... } @ inputs:
outputs = { self, nixpkgs, home-manager, nixvim, nethack, plasma-manager, ... } @ inputs:
let
inherit (self) outputs;
inherit (nixpkgs) lib;
username = "andrey";
hostnames = [ "tokishiko" "maidena" ];
stateVersion = "24.05";
mkSystem = hostname: {
makeSystem = hostname: {
"${hostname}" = nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs; };
system = "x86_64-linux";
modules = [
./system/common.nix
./system/${hostname}.nix
./hardware/${hostname}.nix
{
system.stateVersion = stateVersion;
networking.hostName = hostname;
}
];
};
};
mkHome = hostname: {
extractModule = { homeManagerModules, ... }: homeManagerModules."${lib.head (lib.attrNames homeManagerModules)}";
homeManagerModules = map extractModule [ nixvim nethack plasma-manager ];
makeHome = hostname: {
"${username}@${hostname}" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = inputs;
modules = [
nixvim.homeManagerModules.nixvim
nethack.homeManagerModules.nethack
modules = homeManagerModules ++ [
./home/${hostname}.nix
./home/common.nix
{
news.display = "show";
home.username = username;
home.homeDirectory = "/home/${username}";
home.stateVersion = stateVersion;
}
];
};
};
merge = fn: nixpkgs.lib.fold nixpkgs.lib.mergeAttrs {} (map fn hostnames);
forEachHost = fn: lib.fold lib.mergeAttrs {} (map fn hostnames);
in {
nixosConfigurations = merge mkSystem;
homeConfigurations = merge mkHome;
nixosConfigurations = forEachHost makeSystem;
homeConfigurations = forEachHost makeHome;
};
}
# vim: ts=2 sw=2 et

View File

@@ -1,5 +1,98 @@
{ pkgs, ... }:
{
imports = [
./components/nethack.nix
./components/firefox.nix
];
programs = {
home-manager.enable = true;
fastfetch.enable = true;
htop.enable = true;
bash = {
enable = true;
historyControl = [ "ignoreboth" ];
};
git = {
enable = true;
userName = "xezo360hye";
userEmail = "xezo360hye@gmail.com";
extraConfig = {
init.defaultBranch = "master";
url."https://github.com/".insteadOf = [ "gh:" "github:" ];
url."https://git.psf.lt/".insteadOf = [ "psf:" "gitea:" ];
};
};
nixvim = {
enable = true;
colorschemes.nightfox = {
enable = true;
flavor = "nordfox";
};
plugins = {
guess-indent = {
enable = true;
};
copilot-lua = {
enable = true;
suggestion.autoTrigger = true;
suggestion.keymap = {
accept = "<M-Right>";
acceptLine = "<M-l>";
acceptWord = "<M-w>";
};
};
};
keymaps = [
{
mode = "n";
key = ";";
action = ":";
}
{
mode = "n";
key = "<Esc>";
action = "<Cmd>nohlsearch<CR>";
options = {
silent = true;
};
}
];
};
mpv = {
enable = true;
};
};
nixpkgs.config.allowUnfree = true;
home = {
packages = with pkgs; [
telegram-desktop
libqalculate
arduino-cli
ani-cli
ytfzf
cpufrequtils
steam-run
];
sessionVariables = {
ANI_CLI_PLAYER = "mpv";
};
};
}

View File

@@ -0,0 +1,97 @@
{ pkgs, ... }:
{
programs.firefox = {
enable = true;
profiles.default = {
containersForce = true;
containers = {
social = {
color = "turquoise";
icon = "fence";
id = 1;
};
shopping = {
color = "orange";
icon = "cart";
id = 2;
};
};
search = {
force = true;
default = "DuckDuckGo";
engines = {
"Nix Packages" = {
urls = [{
template = "https://search.nixos.org/packages";
params = [
{ name = "type"; value = "packages"; }
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ];
};
"NixOS Wiki" = {
urls = [{ template = "https://wiki.nixos.org/index.php?search={searchTerms}"; }];
iconUpdateURL = "https://wiki.nixos.org/favicon.png";
updateInterval = 24 * 60 * 60 * 1000;
definedAliases = [ "@nw" ];
};
"MyNixOS" = {
urls = [{ template = "https://mynixos.com/search?q={searchTerms}"; }];
iconUpdateURL = "https://mynixos.com/favicon-light.svg";
definedAliases = [ "@mn" "@mw" ];
};
"Bing".metaData.hidden = true;
"Google".metaData.hidden = true;
"Amazon.com".metaData.hidden = true;
"eBay".metaData.hidden = true;
};
};
};
policies = {
DisableFirefoxStudies = true;
DisableTelemetry = true;
DisablePocket = true;
DontCheckDefaultBrowser = true;
DownloadDirectory = "\${home}";
EnableTrackingProtection = {
Value = true;
Locked = false;
Cryptomining = true;
EmailTracking = true;
Fingerprinting = true;
Exceptions = [];
};
FirefoxHome = {
SponsoredTopSites = false;
Pocket = false;
SponsoredPocket = false;
};
StartDownloadsInTempDirectory = true;
TranslateEnabled = true;
Preferences = {
"browser.translations.automaticallyPopup" = {
Value = false;
Status = "default";
};
};
};
};
}

119
home/components/plasma.nix Normal file
View File

@@ -0,0 +1,119 @@
{
programs.plasma = {
enable = true;
overrideConfig = true;
input.touchpads = [{
enable = true;
name = "SynPS/2 Synaptics TouchPad";
vendorId = "0002";
productId = "0007";
disableWhileTyping = false;
naturalScroll = true;
}];
kwin.edgeBarrier = 0;
workspace = {
clickItemTo = "open";
theme = "breeze-dark";
colorScheme = "BreezeDark";
lookAndFeel = "org.kde.breezedark.desktop";
wallpaper = ../resources/wallpaper.png;
};
panels = [
{
screen = "all";
location = "bottom";
hiding = "dodgewindows";
widgets = [
{
kickoff.icon = "nix-snowflake-white";
}
"org.kde.plasma.pager"
{
iconTasks.launchers = [
"applications:systemsettings.desktop"
"applications:org.kde.dolphin.desktop"
"applications:firefox.desktop"
"applications:org.kde.konsole.desktop"
];
}
"org.kde.plasma.marginseparator"
{
systemTray = {};
}
{
digitalClock = {
date.format = "isoDate";
time.format = "24h";
time.showSeconds = "always";
calendar.firstDayOfWeek = "monday";
};
}
"org.kde.plasma.showdesktop"
];
}
];
window-rules = [
{
description = "Konsole";
match.window-class.value = "konsole org.kde.konsole";
apply = {
maximizehoriz = true;
maximizevert = true;
};
}
];
shortcuts = {
kwin = {
"Window Close" = "Alt+Q";
"Switch One Desktop Up" = "Ctrl+Alt+Up";
"Switch One Desktop Down" = "Ctrl+Alt+Down";
"Switch One Desktop to the Left" = "Ctrl+Alt+Left";
"Switch One Desktop to the Right" = "Ctrl+Alt+Right";
"Window One Desktop Up" = "Ctrl+Alt+Shift+Up";
"Window One Desktop Down" = "Ctrl+Alt+Shift+Down";
"Window One Desktop to the Left" = "Ctrl+Alt+Shift+Left";
"Window One Desktop to the Right" = "Ctrl+Alt+Shift+Right";
};
};
configFile = {
dolphinrc.General = {
RememberOpenedTabs = false;
UseTabForSwitchingSplitView = true;
};
kwinrc.TabBox = {
HighlightWindows = false;
MultiScreenMode = 1;
};
kwinrc.Desktops = {
Number = 4;
Rows = 2;
};
kwinrc.Windows = {
DelayFocusInterval = 0;
FocusPolicy = "FocusFollowsMouse";
NextFocusPrefersMouse = true;
FocusStealingPreventionLevel = 0;
};
kxkbrc.Layout = {
LayoutList = "us,ru";
DisplayNames = ",";
VariantList = ",";
Options = "caps:escape_shifted_capslock,grp:win_space_toggle";
ResetOldOptions = true;
};
};
};
}

View File

@@ -1,57 +1,6 @@
{
imports = [
./components/hyprland.nix
./components/plasma.nix
];
programs = {
home-manager.enable = true;
bash = {
enable = true;
historyControl = [ "ignoreboth" ];
};
git = {
enable = true;
userName = "xezo360hye";
userEmail = "xezo360hye@gmail.com";
extraConfig = {
init.defaultBranch = "master";
url."https://github.com/".insteadOf = [ "gh:" "github:" ];
};
};
neovim = {
enable = true;
viAlias = true;
vimAlias = true;
defaultEditor = true;
extraLuaConfig = ''
vim.cmd "colorscheme desert"
'';
};
fastfetch = {
enable = true;
settings = {};
};
};
home.packages = with pkgs; [
ani-cli
ytfzf
];
home.sessionVariables = {
ANI_CLI_PLAYER = "mpv";
};
home = {
username = "andrey";
homeDirectory = "/home/andrey";
stateVersion = "24.05";
};
}
# vim: ts=2 sw=2 et

Binary file not shown.

After

Width:  |  Height:  |  Size: 529 KiB

View File

@@ -1,173 +1,14 @@
{
programs = {
home-manager.enable = true;
firefox = {
enable = true;
profiles.default = {
containersForce = true;
containers = {
social = {
color = "turquoise";
icon = "fence";
id = 1;
};
shopping = {
color = "orange";
icon = "cart";
id = 2;
};
};
search = {
force = true;
default = "DuckDuckGo";
engines = {
"Nix Packages" = {
urls = [{
template = "https://search.nixos.org/packages";
params = [
{ name = "type"; value = "packages"; }
{ name = "query"; value = "{searchTerms}"; }
];
}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = [ "@np" ];
};
"NixOS Wiki" = {
urls = [{ template = "https://wiki.nixos.org/index.php?search={searchTerms}"; }];
iconUpdateURL = "https://wiki.nixos.org/favicon.png";
updateInterval = 24 * 60 * 60 * 1000;
definedAliases = [ "@nw" ];
};
"MyNixOS" = {
urls = [{ template = "https://mynixos.com/search?q={searchTerms}"; }];
iconUpdateURL = "https://mynixos.com/favicon-light.svg";
definedAliases = [ "@mn" "@mw" ];
};
"Bing".metaData.hidden = true;
"Google".metaData.hidden = true;
"Amazon.com".metaData.hidden = true;
"eBay".metaData.hidden = true;
};
};
};
policies = {
DisableFirefoxStudies = true;
DisableTelemetry = true;
DisablePocket = true;
DontCheckDefaultBrowser = true;
DownloadDirectory = "\${home}";
EnableTrackingProtection = {
Value = true;
Locked = false;
Cryptomining = true;
EmailTracking = true;
Fingerprinting = true;
Exceptions = [];
};
FirefoxHome = {
# TopSites = false;
SponsoredTopSites = false;
Pocket = false;
SponsoredPocket = false;
};
StartDownloadsInTempDirectory = true;
TranslateEnabled = true;
Preferences = {
"browser.translations.automaticallyPopup" = {
Value = false;
Status = "default";
};
};
};
};
bash = {
enable = true;
historyControl = [ "ignoreboth" ];
};
git = {
enable = true;
userName = "xezo360hye";
userEmail = "xezo360hye@gmail.com";
extraConfig = {
init.defaultBranch = "master";
url."https://github.com/".insteadOf = [ "gh:" "github:" ];
url."https://git.psf.lt/".insteadOf = [ "psf:" "gitea:" ];
};
};
nixvim = {
enable = true;
viAlias = true;
vimAlias = true;
defaultEditor = true;
colorschemes.tokyonight.enable = true;
plugins.copilot-lua = {
enable = true;
filetypes = {
markdown = true;
yaml = true;
};
};
};
htop.enable = true;
fastfetch.enable = true;
alacritty.enable = true;
};
xsession.windowManager.awesome = {
enable = true;
noArgb = true;
};
nixpkgs.config.allowUnfree = true;
news.display = "show";
home = {
packages = with pkgs; [
telegram-desktop
arduino-cli
ani-cli
ytfzf
nethack
cpufrequtils
qbittorrent
steam-run
libqalculate
];
sessionVariables = {
ANI_CLI_PLAYER = "mpv";
};
file = {
".config/awesome/rc.lua".source = ./awesomerc.lua;
};
username = "andrey";
homeDirectory = "/home/andrey";
stateVersion = "24.05";
home.file = {
".config/awesome/rc.lua".source = ./components/awesomerc.lua;
};
}
# vim: ts=2 sw=2 et

View File

@@ -1,10 +1,4 @@
{
inputs,
config,
pkgs,
lib,
...
}:
{ inputs, config, pkgs, lib, ... }:
let flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
in
{
@@ -59,10 +53,22 @@ in
security.sudo.wheelNeedsPassword = false;
# Programs
programs = {
git = {
enable = true;
config = {
init.defaultBranch = "master";
url."https://github.com/".insteadOf = [ "gh:" "github:" ];
url."https://git.psf.lt/".insteadOf = [ "psf:" "gitea:" ];
};
};
};
# Packages
environment.systemPackages = with pkgs; [
alsa-utils
mpv
];
@@ -84,8 +90,4 @@ in
tappingDragLock = false;
};
};
# Something important
system.stateVersion = "24.05";
}

View File

@@ -1,13 +1,4 @@
{
inputs,
config,
pkgs,
lib,
...
}:
{
networking.hostName = "maidena";
services = {
desktopManager.plasma6.enable = true;
displayManager.sddm = {
@@ -16,4 +7,3 @@
};
};
}
# vim: ts=2 sw=2 et

View File

@@ -1,12 +1,4 @@
{
inputs,
config,
pkgs,
lib,
...
}:
{
networking.hostName = "tokishiko";
console.keyMap = "no";
services = {
@@ -21,4 +13,3 @@
};
};
}
# vim: ts=2 sw=2 et