commit a64093ce1945a28736cd83e6e66e0de054eab8db Author: xezo360hye Date: Sun Aug 4 21:15:01 2024 +0300 Initial commit diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..0792a50 --- /dev/null +++ b/flake.lock @@ -0,0 +1,320 @@ +{ + "nodes": { + "devshell": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1722113426, + "narHash": "sha256-Yo/3loq572A8Su6aY5GP56knpuKYRvM2a1meP9oJZCw=", + "owner": "numtide", + "repo": "devshell", + "rev": "67cce7359e4cd3c45296fb4aaf6a19e2a9c757ae", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, + "flake-compat": { + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "revCount": 57, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1719994518, + "narHash": "sha256-pQMhCCHyQGRzdfAkdJ4cIWiw+JNuWsTX7f0ZYSyz0VY=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "9227223f6d922fee3c7b190b2cc238a99527bbb7", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "git-hooks": { + "inputs": { + "flake-compat": [ + "nixvim", + "flake-compat" + ], + "gitignore": "gitignore", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ], + "nixpkgs-stable": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1721042469, + "narHash": "sha256-6FPUl7HVtvRHCCBQne7Ylp4p+dpP3P/OYuzjztZ4s70=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "f451c19376071a90d8c58ab1a953c6e9840527fd", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "nixvim", + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1722630065, + "narHash": "sha256-QfM/9BMRkCmgWzrPDK+KbgJOUlSJnfX4OvsUupEUZvA=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "afc892db74d65042031a093adb6010c4c3378422", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1722407237, + "narHash": "sha256-wcpVHUc2nBSSgOM7UJSpcRbyus4duREF31xlzHV5T+A=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "58cef3796271aaeabaed98884d4abaab5d9d162d", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nethack": { + "locked": { + "lastModified": 1720287571, + "narHash": "sha256-thiVJSiCuMgK2zYmCvhfJAWdawb4GyRPoqipbrZFoGw=", + "ref": "refs/heads/master", + "rev": "10fc937bbb527fbf419a7a6dc2bf4edd4c340b48", + "shallow": true, + "type": "git", + "url": "https://git.psf.lt/xezo360hye/nethack" + }, + "original": { + "shallow": true, + "type": "git", + "url": "https://git.psf.lt/xezo360hye/nethack" + } + }, + "nix-darwin": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1722082646, + "narHash": "sha256-od8dBWVP/ngg0cuoyEl/w9D+TCNDj6Kh4tr151Aax7w=", + "owner": "lnl7", + "repo": "nix-darwin", + "rev": "0413754b3cdb879ba14f6e96915e5fdf06c6aab6", + "type": "github" + }, + "original": { + "owner": "lnl7", + "repo": "nix-darwin", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1722421184, + "narHash": "sha256-/DJBI6trCeVnasdjUo9pbnodCLZcFqnVZiLUfqLH4jA=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "9f918d616c5321ad374ae6cb5ea89c9e04bf3e58", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixvim": { + "inputs": { + "devshell": "devshell", + "flake-compat": "flake-compat", + "flake-parts": "flake-parts", + "git-hooks": "git-hooks", + "home-manager": "home-manager_2", + "nix-darwin": "nix-darwin", + "nixpkgs": [ + "nixpkgs" + ], + "nuschtosSearch": "nuschtosSearch", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1722694915, + "narHash": "sha256-8UEWZ1zO8hUttsW9Zv+kjlJkGVD3Xnr5gulK7x1FcuQ=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "96d0a2e390128be2ea19b714d4215326abfadf83", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixvim", + "type": "github" + } + }, + "nuschtosSearch": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1722144272, + "narHash": "sha256-olZbfaEdd+zNPuuyYcYGaRzymA9rOmth8yXOlVm+LUs=", + "owner": "NuschtOS", + "repo": "search", + "rev": "16565307c267ec219c2b5d3494ba66df08e7d403", + "type": "github" + }, + "original": { + "owner": "NuschtOS", + "repo": "search", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nethack": "nethack", + "nixpkgs": "nixpkgs", + "nixvim": "nixvim" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1722330636, + "narHash": "sha256-uru7JzOa33YlSRwf9sfXpJG+UAV+bnBEYMjrzKrQZFw=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "768acdb06968e53aa1ee8de207fd955335c754b7", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..bd1367d --- /dev/null +++ b/flake.nix @@ -0,0 +1,63 @@ +{ + description = "My homebrew NixOS configurations"; + + inputs = { + nixpkgs.url = github:nixos/nixpkgs/nixos-unstable; + + home-manager = { + url = github:nix-community/home-manager; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + nixvim = { + url = github:nix-community/nixvim; + 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; + }; + + # nixpkgs-2405.url = github:nixos/nixpkgs/nixos-24.05; + # hm-2405.url = github:nix-community/home-manager/release-24.05; + }; + + outputs = { self, nixpkgs, home-manager, nixvim, nethack, ... } @ inputs: + let + inherit (self) outputs; + + username = "andrey"; + hostnames = [ "tokishiko" "maidena" ]; + + mkSystem = hostname: { + "${hostname}" = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs; }; + system = "x86_64-linux"; + modules = [ + ./system/${hostname}.nix + ./hardware/${hostname}.nix + ]; + }; + }; + + mkHome = hostname: { + "${username}@${hostname}" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.x86_64-linux; + extraSpecialArgs = inputs; + modules = [ + nixvim.homeManagerModules.nixvim + nethack.homeManagerModules.nethack + ./home/${hostname}.nix + ]; + }; + }; + + merge = fn: nixpkgs.lib.fold nixpkgs.lib.mergeAttrs {} (map fn hostnames); + in { + nixosConfigurations = merge mkSystem; + homeConfigurations = merge mkHome; + }; +} +# vim: ts=2 sw=2 et diff --git a/hardware/maidena.nix b/hardware/maidena.nix new file mode 100644 index 0000000..37ffb6e --- /dev/null +++ b/hardware/maidena.nix @@ -0,0 +1,35 @@ +# 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 = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "xhci_pci" "usb_storage" "sd_mod" "sr_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/f163fc67-93f0-4bb9-a4aa-1b48ab215fe6"; + fsType = "xfs"; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/14607fcc-7fc2-4274-925e-4ec864fd6a30"; } + ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp38s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hardware/tokishiko.nix b/hardware/tokishiko.nix new file mode 100644 index 0000000..3c6092d --- /dev/null +++ b/hardware/tokishiko.nix @@ -0,0 +1,33 @@ +# 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 = + [ (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "xhci_pci" "firewire_ohci" "usb_storage" "sd_mod" "sr_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/98ff21ae-1adf-469e-8cea-3bd04cc564ab"; + fsType = "xfs"; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp0s25.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/home/awesomerc.lua b/home/awesomerc.lua new file mode 100644 index 0000000..e6791f3 --- /dev/null +++ b/home/awesomerc.lua @@ -0,0 +1,552 @@ +-- If LuaRocks is installed, make sure that packages installed through it are +-- found (e.g. lgi). If LuaRocks is not installed, do nothing. +pcall(require, "luarocks.loader") + +-- Standard awesome library +local gears = require("gears") +local awful = require("awful") +require("awful.autofocus") +-- Widget and layout library +local wibox = require("wibox") +-- Theme handling library +local beautiful = require("beautiful") +-- Notification library +local naughty = require("naughty") +local menubar = require("menubar") +local hotkeys_popup = require("awful.hotkeys_popup") +-- Enable hotkeys help widget for VIM and other apps +-- when client with a matching name is opened: +require("awful.hotkeys_popup.keys") + +-- {{{ Error handling +-- Check if awesome encountered an error during startup and fell back to +-- another config (This code will only ever execute for the fallback config) +if awesome.startup_errors then + naughty.notify({ preset = naughty.config.presets.critical, + title = "Oops, there were errors during startup!", + text = awesome.startup_errors }) +end + +-- Handle runtime errors after startup +do + local in_error = false + awesome.connect_signal("debug::error", function (err) + -- Make sure we don't go into an endless error loop + if in_error then return end + in_error = true + + naughty.notify({ preset = naughty.config.presets.critical, + title = "Oops, an error happened!", + text = tostring(err) }) + in_error = false + end) +end +-- }}} + +-- {{{ Variable definitions +-- Themes define colours, icons, font and wallpapers. +beautiful.init(gears.filesystem.get_themes_dir() .. "default/theme.lua") + +-- This is used later as the default terminal and editor to run. +terminal = "alacritty" +editor = os.getenv("EDITOR") or "nano" +editor_cmd = terminal .. " -e " .. editor + +-- Default modkey. +-- Usually, Mod4 is the key with a logo between Control and Alt. +-- If you do not like this or do not have such a key, +-- I suggest you to remap Mod4 to another key using xmodmap or other tools. +-- However, you can use another modifier like Mod1, but it may interact with others. +modkey = "Mod4" + +-- Table of layouts to cover with awful.layout.inc, order matters. +awful.layout.layouts = { + awful.layout.suit.max, + awful.layout.suit.fair, + awful.layout.suit.tile, + awful.layout.suit.max.fullscreen, +} +-- }}} + +-- {{{ Menu +-- Create a launcher widget and a main menu +myawesomemenu = { + { "hotkeys", function() hotkeys_popup.show_help(nil, awful.screen.focused()) end }, + { "manual", terminal .. " -e man awesome" }, + { "edit config", editor_cmd .. " " .. awesome.conffile }, + { "restart", awesome.restart }, + { "quit", function() awesome.quit() end }, +} + +mymainmenu = awful.menu({ items = { { "awesome", myawesomemenu, beautiful.awesome_icon }, + { "open terminal", terminal } + } + }) + +mylauncher = awful.widget.launcher({ image = beautiful.awesome_icon, + menu = mymainmenu }) + +-- Menubar configuration +menubar.utils.terminal = terminal -- Set the terminal for applications that require it +-- }}} + +-- Keyboard map indicator and switcher +mykeyboardlayout = awful.widget.keyboardlayout() + +-- {{{ Wibar +-- Create a textclock widget +mytextclock = wibox.widget.textclock() + +-- Create a wibox for each screen and add it +local taglist_buttons = gears.table.join( + awful.button({ }, 1, function(t) t:view_only() end), + awful.button({ modkey }, 1, function(t) + if client.focus then + client.focus:move_to_tag(t) + end + end), + awful.button({ }, 3, awful.tag.viewtoggle), + awful.button({ modkey }, 3, function(t) + if client.focus then + client.focus:toggle_tag(t) + end + end), + awful.button({ }, 4, function(t) awful.tag.viewnext(t.screen) end), + awful.button({ }, 5, function(t) awful.tag.viewprev(t.screen) end) + ) + +local tasklist_buttons = gears.table.join( + awful.button({ }, 1, function (c) + if c == client.focus then + c.minimized = true + else + c:emit_signal( + "request::activate", + "tasklist", + {raise = true} + ) + end + end), + awful.button({ }, 3, function() + awful.menu.client_list({ theme = { width = 250 } }) + end), + awful.button({ }, 4, function () + awful.client.focus.byidx(1) + end), + awful.button({ }, 5, function () + awful.client.focus.byidx(-1) + end)) + +local function set_wallpaper(s) + -- Wallpaper + if beautiful.wallpaper then + local wallpaper = beautiful.wallpaper + -- If wallpaper is a function, call it with the screen + if type(wallpaper) == "function" then + wallpaper = wallpaper(s) + end + gears.wallpaper.maximized(wallpaper, s, true) + end +end + +-- Re-set wallpaper when a screen's geometry changes (e.g. different resolution) +screen.connect_signal("property::geometry", set_wallpaper) + +awful.screen.connect_for_each_screen(function(s) + -- Wallpaper + set_wallpaper(s) + + -- Each screen has its own tag table. + awful.tag({ "1", "2", "3", "4", "5", "6", "7", "8", "9" }, s, awful.layout.layouts[1]) + + -- Create a promptbox for each screen + s.mypromptbox = awful.widget.prompt() + -- Create an imagebox widget which will contain an icon indicating which layout we're using. + -- We need one layoutbox per screen. + s.mylayoutbox = awful.widget.layoutbox(s) + s.mylayoutbox:buttons(gears.table.join( + awful.button({ }, 1, function () awful.layout.inc( 1) end), + awful.button({ }, 3, function () awful.layout.inc(-1) end), + awful.button({ }, 4, function () awful.layout.inc( 1) end), + awful.button({ }, 5, function () awful.layout.inc(-1) end))) + -- Create a taglist widget + s.mytaglist = awful.widget.taglist { + screen = s, + filter = awful.widget.taglist.filter.all, + buttons = taglist_buttons + } + + -- Create a tasklist widget + s.mytasklist = awful.widget.tasklist { + screen = s, + filter = awful.widget.tasklist.filter.currenttags, + buttons = tasklist_buttons + } + + -- Create the wibox + s.mywibox = awful.wibar({ position = "top", screen = s }) + + -- Add widgets to the wibox + s.mywibox:setup { + layout = wibox.layout.align.horizontal, + { -- Left widgets + layout = wibox.layout.fixed.horizontal, + mylauncher, + s.mytaglist, + s.mypromptbox, + }, + s.mytasklist, -- Middle widget + { -- Right widgets + layout = wibox.layout.fixed.horizontal, + mykeyboardlayout, + wibox.widget.systray(), + mytextclock, + s.mylayoutbox, + }, + } +end) +-- }}} + +-- {{{ Mouse bindings +root.buttons(gears.table.join( + awful.button({ }, 3, function () mymainmenu:toggle() end), + awful.button({ }, 4, awful.tag.viewnext), + awful.button({ }, 5, awful.tag.viewprev) +)) +-- }}} + +-- {{{ Key bindings +globalkeys = gears.table.join( + awful.key({ modkey, }, "s", hotkeys_popup.show_help, + {description="show help", group="awesome"}), + awful.key({ modkey, "Control" }, "Left", awful.tag.viewprev, + {description = "view previous", group = "tag"}), + awful.key({ modkey, "Control" }, "Right", awful.tag.viewnext, + {description = "view next", group = "tag"}), + awful.key({ modkey, }, "Escape", awful.tag.history.restore, + {description = "go back", group = "tag"}), + + awful.key({ modkey, }, "j", + function () + awful.client.focus.byidx( 1) + end, + {description = "focus next by index", group = "client"} + ), + awful.key({ modkey, }, "k", + function () + awful.client.focus.byidx(-1) + end, + {description = "focus previous by index", group = "client"} + ), + awful.key({ modkey, }, "w", function () mymainmenu:show() end, + {description = "show main menu", group = "awesome"}), + + -- Layout manipulation + awful.key({ modkey, "Shift" }, "j", function () awful.client.swap.byidx( 1) end, + {description = "swap with next client by index", group = "client"}), + awful.key({ modkey, "Shift" }, "k", function () awful.client.swap.byidx( -1) end, + {description = "swap with previous client by index", group = "client"}), + awful.key({ modkey, "Control" }, "j", function () awful.screen.focus_relative( 1) end, + {description = "focus the next screen", group = "screen"}), + awful.key({ modkey, "Control" }, "k", function () awful.screen.focus_relative(-1) end, + {description = "focus the previous screen", group = "screen"}), + awful.key({ modkey, }, "u", awful.client.urgent.jumpto, + {description = "jump to urgent client", group = "client"}), + awful.key({ modkey, }, "Tab", + function () + awful.client.focus.history.previous() + if client.focus then + client.focus:raise() + end + end, + {description = "go back", group = "client"}), + + -- Standard program + awful.key({ modkey, }, "Return", function () awful.spawn(terminal) end, + {description = "open a terminal", group = "launcher"}), + awful.key({ modkey, "Control" }, "r", awesome.restart, + {description = "reload awesome", group = "awesome"}), + awful.key({ modkey, "Shift" }, "q", awesome.quit, + {description = "quit awesome", group = "awesome"}), + + awful.key({ modkey, }, "l", function () awful.tag.incmwfact( 0.05) end, + {description = "increase master width factor", group = "layout"}), + awful.key({ modkey, }, "h", function () awful.tag.incmwfact(-0.05) end, + {description = "decrease master width factor", group = "layout"}), + awful.key({ modkey, "Shift" }, "h", function () awful.tag.incnmaster( 1, nil, true) end, + {description = "increase the number of master clients", group = "layout"}), + awful.key({ modkey, "Shift" }, "l", function () awful.tag.incnmaster(-1, nil, true) end, + {description = "decrease the number of master clients", group = "layout"}), + awful.key({ modkey, "Control" }, "h", function () awful.tag.incncol( 1, nil, true) end, + {description = "increase the number of columns", group = "layout"}), + awful.key({ modkey, "Control" }, "l", function () awful.tag.incncol(-1, nil, true) end, + {description = "decrease the number of columns", group = "layout"}), + awful.key({ modkey, }, "space", function () awful.layout.inc( 1) end, + {description = "select next", group = "layout"}), + awful.key({ modkey, "Shift" }, "space", function () awful.layout.inc(-1) end, + {description = "select previous", group = "layout"}), + + awful.key({ modkey, "Control" }, "n", + function () + local c = awful.client.restore() + -- Focus restored client + if c then + c:emit_signal( + "request::activate", "key.unminimize", {raise = true} + ) + end + end, + {description = "restore minimized", group = "client"}), + + -- Prompt + awful.key({ modkey }, "r", function () awful.screen.focused().mypromptbox:run() end, + {description = "run prompt", group = "launcher"}), + + awful.key({ modkey }, "x", + function () + awful.prompt.run { + prompt = "Run Lua code: ", + textbox = awful.screen.focused().mypromptbox.widget, + exe_callback = awful.util.eval, + history_path = awful.util.get_cache_dir() .. "/history_eval" + } + end, + {description = "lua execute prompt", group = "awesome"}), + -- Menubar + awful.key({ modkey }, "p", function() menubar.show() end, + {description = "show the menubar", group = "launcher"}) +) + +clientkeys = gears.table.join( + awful.key({ modkey, }, "f", + function (c) + c.fullscreen = not c.fullscreen + c:raise() + end, + {description = "toggle fullscreen", group = "client"}), + awful.key({ modkey, "Shift" }, "c", function (c) c:kill() end, + {description = "close", group = "client"}), + awful.key({ modkey, "Control" }, "space", awful.client.floating.toggle , + {description = "toggle floating", group = "client"}), + awful.key({ modkey, "Control" }, "Return", function (c) c:swap(awful.client.getmaster()) end, + {description = "move to master", group = "client"}), + awful.key({ modkey, }, "o", function (c) c:move_to_screen() end, + {description = "move to screen", group = "client"}), + awful.key({ modkey, }, "t", function (c) c.ontop = not c.ontop end, + {description = "toggle keep on top", group = "client"}), + awful.key({ modkey, }, "n", + function (c) + -- The client currently has the input focus, so it cannot be + -- minimized, since minimized clients can't have the focus. + c.minimized = true + end , + {description = "minimize", group = "client"}), + awful.key({ modkey, }, "m", + function (c) + c.maximized = not c.maximized + c:raise() + end , + {description = "(un)maximize", group = "client"}), + awful.key({ modkey, "Control" }, "m", + function (c) + c.maximized_vertical = not c.maximized_vertical + c:raise() + end , + {description = "(un)maximize vertically", group = "client"}), + awful.key({ modkey, "Shift" }, "m", + function (c) + c.maximized_horizontal = not c.maximized_horizontal + c:raise() + end , + {description = "(un)maximize horizontally", group = "client"}) +) + +-- Bind all key numbers to tags. +-- Be careful: we use keycodes to make it work on any keyboard layout. +-- This should map on the top row of your keyboard, usually 1 to 9. +for i = 1, 9 do + globalkeys = gears.table.join(globalkeys, + -- View tag only. + awful.key({ modkey }, "#" .. i + 9, + function () + local screen = awful.screen.focused() + local tag = screen.tags[i] + if tag then + tag:view_only() + end + end, + {description = "view tag #"..i, group = "tag"}), + -- Toggle tag display. + awful.key({ modkey, "Control" }, "#" .. i + 9, + function () + local screen = awful.screen.focused() + local tag = screen.tags[i] + if tag then + awful.tag.viewtoggle(tag) + end + end, + {description = "toggle tag #" .. i, group = "tag"}), + -- Move client to tag. + awful.key({ modkey, "Shift" }, "#" .. i + 9, + function () + if client.focus then + local tag = client.focus.screen.tags[i] + if tag then + client.focus:move_to_tag(tag) + end + end + end, + {description = "move focused client to tag #"..i, group = "tag"}), + -- Toggle tag on focused client. + awful.key({ modkey, "Control", "Shift" }, "#" .. i + 9, + function () + if client.focus then + local tag = client.focus.screen.tags[i] + if tag then + client.focus:toggle_tag(tag) + end + end + end, + {description = "toggle focused client on tag #" .. i, group = "tag"}) + ) +end + +clientbuttons = gears.table.join( + awful.button({ }, 1, function (c) + c:emit_signal("request::activate", "mouse_click", {raise = true}) + end), + awful.button({ modkey }, 1, function (c) + c:emit_signal("request::activate", "mouse_click", {raise = true}) + awful.mouse.client.move(c) + end), + awful.button({ modkey }, 3, function (c) + c:emit_signal("request::activate", "mouse_click", {raise = true}) + awful.mouse.client.resize(c) + end) +) + +-- Set keys +root.keys(globalkeys) +-- }}} + +-- {{{ Rules +-- Rules to apply to new clients (through the "manage" signal). +awful.rules.rules = { + -- All clients will match this rule. + { rule = { }, + properties = { border_width = beautiful.border_width, + border_color = beautiful.border_normal, + focus = awful.client.focus.filter, + raise = true, + keys = clientkeys, + buttons = clientbuttons, + screen = awful.screen.preferred, + placement = awful.placement.no_overlap+awful.placement.no_offscreen + } + }, + + -- Floating clients. + { rule_any = { + instance = { + "DTA", -- Firefox addon DownThemAll. + "copyq", -- Includes session name in class. + "pinentry", + }, + class = { + "Arandr", + "Blueman-manager", + "Gpick", + "Kruler", + "MessageWin", -- kalarm. + "Sxiv", + "Tor Browser", -- Needs a fixed window size to avoid fingerprinting by screen size. + "Wpa_gui", + "veromix", + "xtightvncviewer"}, + + -- Note that the name property shown in xprop might be set slightly after creation of the client + -- and the name shown there might not match defined rules here. + name = { + "Event Tester", -- xev. + }, + role = { + "AlarmWindow", -- Thunderbird's calendar. + "ConfigManager", -- Thunderbird's about:config. + "pop-up", -- e.g. Google Chrome's (detached) Developer Tools. + } + }, properties = { floating = true }}, + + -- Add titlebars to normal clients and dialogs + { rule_any = {type = { "normal", "dialog" } + }, properties = { titlebars_enabled = true } + }, + + -- Set Firefox to always map on the tag named "2" on screen 1. + -- { rule = { class = "Firefox" }, + -- properties = { screen = 1, tag = "2" } }, +} +-- }}} + +-- {{{ Signals +-- Signal function to execute when a new client appears. +client.connect_signal("manage", function (c) + -- Set the windows at the slave, + -- i.e. put it at the end of others instead of setting it master. + -- if not awesome.startup then awful.client.setslave(c) end + + if awesome.startup + and not c.size_hints.user_position + and not c.size_hints.program_position then + -- Prevent clients from being unreachable after screen count changes. + awful.placement.no_offscreen(c) + end +end) + +-- Add a titlebar if titlebars_enabled is set to true in the rules. +client.connect_signal("request::titlebars", function(c) + -- buttons for the titlebar + local buttons = gears.table.join( + awful.button({ }, 1, function() + c:emit_signal("request::activate", "titlebar", {raise = true}) + awful.mouse.client.move(c) + end), + awful.button({ }, 3, function() + c:emit_signal("request::activate", "titlebar", {raise = true}) + awful.mouse.client.resize(c) + end) + ) + + awful.titlebar(c) : setup { + { -- Left + awful.titlebar.widget.iconwidget(c), + buttons = buttons, + layout = wibox.layout.fixed.horizontal + }, + { -- Middle + { -- Title + align = "center", + widget = awful.titlebar.widget.titlewidget(c) + }, + buttons = buttons, + layout = wibox.layout.flex.horizontal + }, + { -- Right + awful.titlebar.widget.floatingbutton (c), + awful.titlebar.widget.maximizedbutton(c), + awful.titlebar.widget.stickybutton (c), + awful.titlebar.widget.ontopbutton (c), + awful.titlebar.widget.closebutton (c), + layout = wibox.layout.fixed.horizontal() + }, + layout = wibox.layout.align.horizontal + } +end) + +-- Enable sloppy focus, so that focus follows mouse. +client.connect_signal("mouse::enter", function(c) + c:emit_signal("request::activate", "mouse_enter", {raise = false}) +end) + +client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) +client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) +-- }}} diff --git a/home/maidena.nix b/home/maidena.nix new file mode 100644 index 0000000..dde26eb --- /dev/null +++ b/home/maidena.nix @@ -0,0 +1,127 @@ +{ + inputs, + config, + pkgs, + lib, + ... +}: +let genFlatList = f: n: builtins.concatLists (builtins.genList f n); +in +{ + 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 = {}; + }; + + kitty = { + enable = true; + }; + }; + + wayland.windowManager.hyprland = { + enable = true; + settings = { + general = { + gaps_in = 5; + gaps_out = 20; + + border_size = 2; + + "col.active_border" = "rgba(33ccffee) rgba(00ff99ee) 45deg"; + "col.inactive_border" = "rgba(595959aa)"; + + resize_on_border = true; + }; + + input.kb_layout = "no"; + input.touchpad.natural_scroll = true; + + decoration = { + rounding = 0; + + active_opacity = 1.0; + inactive_opacity = 1.0; + + drop_shadow = true; + shadow_range = 4; + shadow_render_power = 3; + + "col.shadow" = "rgba(1a1a1aee)"; + + blur = { + enabled = true; + size = 3; + passes = 1; + vibrancy = 0.1696; + }; + }; + + bind = [ + "SUPER, Return, exec, kitty" + "SUPER SHIFT, Q, exit" + + "SUPER, V, togglefloating" + "SUPER, J, togglesplit" + "SUPER, P, pseudo" + + "ALT CTRL, left, workspace, -1" + "ALT CTRL, right, workspace, +1" + ] ++ ( + genFlatList + ( x: let n = toString (x + 1); + in + [ "SUPER, ${n}, workspace, ${n}" + "SUPER SHIFT, ${n}, movetoworkspace, ${n}" + ] + ) + 9 + ); + }; + }; + + 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 diff --git a/home/tokishiko.nix b/home/tokishiko.nix new file mode 100644 index 0000000..e6540e6 --- /dev/null +++ b/home/tokishiko.nix @@ -0,0 +1,445 @@ +{ + inputs, + config, + pkgs, + lib, + ... +}: + +{ + programs = { + home-manager.enable = true; + + nethack = { + enable = true; + nethack_options = { + windowtype = "curses"; + align_message = "bottom"; + msg_window = "reverse"; + msghistory = 1000; + statuslines = 3; + + hitpointbar = true; + perm_invent = true; + showscore = true; + showrace = true; + showexp = true; + time = true; + + hilite_pet = true; + statushilites = true; + lit_corridor = true; + use_darkgray = true; + menucolors = true; + + autopickup = true; + pickup_burden = "B"; + disclose = "+iagcvo"; + sortloot = "full"; + runmode = "crawl"; + boulder = "0"; + + gender = "male"; + }; + + choose_options = { + wizard.nethack_options = { + race = "elf"; + role = "wizard"; + pickup_types = ''$!="+?''; + }; + + tourist.nethack_options = { + role = "tourist"; + pickup_types = ''$!="+?''; + }; + + caveman.nethack_options = { + race = "dwarf"; + role = "caveman"; + pickup_types = ''$!=%"?()''; + }; + }; + + hilite_status = { + hitpoints = { + "100%" = "grey"; + "<100%" = "green"; + "<66%" = "yellow"; + "<50%" = "orange"; + "<33%" = "red&bold"; + "<15%" = "red&inverse"; + }; + + power = { + "100%" = "grey"; + "<100%" = "green"; + "<66%" = "yellow"; + "<50%" = "orange"; + "<33%" = "red&bold"; + }; + + cap = { + burdened = "yellow"; + stressed = "orange"; + strained = "red&bold"; + overtaxed = "red&inverse"; + overloaded = "red&inverse&blink"; + }; + + hunger = { + satiated = "yellow"; + hungry = "orange"; + weak = "red&bold"; + fainting = "red&inverse"; + fainted = "red&inverse&blink"; + }; + + condition = { + slime = "red&inverse"; + hallu = "yellow"; + conf = "orange"; + stun = "red&bold"; + termill = "red&inverse"; + foodpois = "red&inverse"; + }; + + characteristics = { + up = "green"; + down = "red"; + }; + + gold = { + up = "yellow"; + down = "brown"; + }; + }; + + msg_types = { + stop = [ + "The .* (grabs|swings itself around) you!" + "You don't feel very well." + "You are turning a little green." + "Your limbs are getting oozy." + "Your skin begins to peel away." + "You are turning into a green slime." + "You are slowing down." + "Your limbs are stiffening." + "It constricts your throat!" + "You find it hard to breathe." + "You're gasping for air." + "Your blood is having trouble reaching your brain." + "You can no longer breathe." + "You're turning blue." + "You faint from lack of food" + "Your consciousness is fading." + "You regain consciousness" + + "You feel weak" + "You feel weak now" + "You are beginning to feel weak" + "You feel deathly sick" + "You feel (much|even) worse" + + "You feel more confident " + + "You only feel hungry now" + " needs food, badly!" + "You feel hungry" + "You are beginning to feel hungry" + "You are getting the munchies" + "You still have the munchies" + "The munchies are interfering with your motor capabilities" + "You now have a lesser case of the munchies" + ]; + + hide = [ + "You swap places with .*" + ]; + }; + + menu_colors = { + " blessed " = "green"; + " holy " = "green"; + " cursed " = "red"; + " unholy " = "red"; + " cursed .* (being (worn|wielded))" = "orange&underline"; + " !C" = "white"; + " !B" = "white"; + " !UC" = "white"; + " uncursed| UC?($| )" = "white"; + " \\([-0-9]+:[-0-9]+\\)" = "white"; + " [+-][0-9]" = "white"; + " blessed| B($| )" = "cyan"; + " cursed| C($| )" = "red"; + " holy water" = "cyan&bold"; + " blessed clear potion" = "cyan&bold"; + " blessed potions? called water" = "cyan&bold"; + " clear potions? named (holy|blessed|B)($| )" = "cyan&bold"; + " potions? of water named (holy|blessed|B)($| )" = "cyan&bold"; + " potions? called water named (holy|blessed|B)($| )" = "cyan&bold"; + " unholy water" = "orange"; + " cursed clear potion" = "orange"; + " cursed potions? called water" = "orange"; + " potions? called water named (unholy|cursed|C)($| )" = "orange"; + "(food |cram |K-|C-)ration|gunyoki" = "green&bold"; + "lembas wafer|melon|carrot|tins? .* spinach" = "green&bold"; + " oranges?( named.*)?$" = "green&bold"; + " pears?( named.*)?$" = "green&bold"; + " (apple|banana|kelp|eucalyptus|garlic|wolfsbane)" = "green&bold"; + " (slime mold|brain)" = "green&bold"; + "(tins? of )?(gelatinous cube|acid blob|quivering blob)( corpse)?" = "green&bold"; + "(tins? of )?(blue|spotted|ochre) jelly( corpse)?" = "green&bold"; + "(tins? of )?lichen|shrieker|violet fungus|(brown|yellow|green|red) mold( corpse)?" = "green&bold"; + "egg|pancake|fortune cookie|candy bar|royal jelly|cream pie|candle" = "green"; + "(tin of )?brown pudding|gray ooze( corpse)?" = "green"; + " bag .* holding" = "magenta"; + " luck(stone)?($| )" = "magenta"; + " wand .* wish(ing)?($| )" = "magenta"; + " wand .* tele(port(ation)?)?($| )" = "magenta"; + " wand .* polymorph" = "magenta"; + " wand .* death" = "magenta"; + " gain level" = "magenta"; + " full healing" = "magenta"; + " magic marker" = "magenta"; + " magic lamp|lamp .* magic" = "magenta"; + " unicorn horn[^[]*$" = "magenta"; + " tinning kit" = "magenta"; + " ring .* regen(eration)?($| )" = "magenta"; + " ring .* conflict" = "magenta"; + " ring .* (FA|free action)($| )" = "magenta"; + " ring .* (TC|teleport control)($| )" = "magenta"; + " ring .* lev(itation)?($| )" = "magenta"; + " scrolls? .* genocide($| )" = "magenta"; + " scrolls? .* charging($| )" = "magenta"; + " scrolls? .* identify($| )" = "magenta"; + " amulet .* (life ?saving|LS)($| )" = "magenta"; + " amulet .* ref(lection)?($| )" = "magenta"; + " c(o|hi)ckatrice (corpse|egg)" = "magenta"; + " egg .* cockatrice" = "magenta"; + " stethoscope" = "magenta"; + "tooled horn|fire horn|frost horn|horn .* (tooled|fire|frost)" = "magenta"; + " harp" = "magenta"; + " bugle" = "magenta"; + " flute" = "magenta"; + "piece of cloth|opera cloak|ornamental cope|tattered cape" = "magenta"; + "plumed helmet|etched helmet|crested helmet|visored helmet" = "magenta"; + "(old|padded|riding|fencing) gloves" = "magenta"; + "(mud|buckled|riding|snow|hiking|combat|jungle) boots" = "magenta"; + " (Dragonbane|Fire Brand|Frost Brand|Ogresmasher|Trollsbane|Werebane)" = "lightgreen"; + " (Demonbane|Excalibur|Grayswandir|Snickersnee|Sunsword)" = "lightgreen"; + " (Orb of Detection|Sceptre of Might|Magic Mirror of Merlin|Mitre of Holiness|Tsurugi of Muramasa)" = "lightgreen"; + " (Cleaver|Giantslayer|Magicbane|Mjollnir|Vorpal Blade)" = "lightgreen"; + " (Heart of Ahriman|Staff of Aesculapius|Eyes of the Overworld|Platinum Yendorian Express Card|Orb of Fate|Eye of the Aethiopica)" = "lightgreen"; + " (Grimtooth|Orcrist|Sting|Stormbringer)" = "lightgreen"; + " (Longbow of Diana|Master Key of Thievery)" = "lightgreen"; + " (Bell of Opening|silver bell|Candelabrum of Invocation|candelabrum|Book of the Dead|papyrus spellbook)" = "magenta&bold"; + " Amulet of Yendor named" = "magenta&bold"; + " cursed.* bag .* holding" = "red&bold"; + " cursed.* luck(stone)?($| )" = "red&bold"; + " cursed.* unicorn horn" = "red&bold"; + " cursed.* (Bell of Opening|silver bell|Candelabrum of Invocation|candelabrum|Book of the Dead|papyrus spellbook)" = "red&bold"; + "cursed tins? .* spinach|tins? .* spinach .* (cursed|C($| ))" = "red"; + " load(stone)?($| )" = "red&underline"; + " bag .* tricks" = "blue&underline"; + " wand .*[^!]canc" = "blue&underline"; + " wand .* vanish" = "blue&underline"; + " gold piece" = "yellow"; + " valuable" = "brown"; + " gems? .* hard" = "yellow"; + " ([0-9]+|an?|gems? .*) (uncursed |cursed |blessed )?(dilithium|opal|garnet|jasper|agate|jet|obsidian|jade|citrine|chrysoberyl|amber|amethyst|fluorite|turquoise)(e?s)?( stones?| gems?| crystals?)?( named .*)?$" = "brown"; + " ([0-9]+|an?|gems?.*) (uncursed |cursed |blessed )?(diamond|rub(y|ies)|jacinth|sapphire|black opal|emerald|topaz|aquamarine)(e?s)?( stones?| gems?)?( named .*)?$" = "yellow"; + " 0%" = "white"; + " [1-9]%" = "cyan"; + " [12][0-9]%" = "cyan"; + " [3-6][0-9]%" = "yellow"; + " 7[0-5]%" = "yellow"; + " 7[6-9]%" = "orange"; + " 8[0-9]%" = "orange"; + " 9[0-9]%" = "red"; + " 100%" = "red"; + "[a-zA-Z ]+ [0-9]\\* [a-z]+ +[0-9]+%" = "magenta"; + "^ +[a-z -]+ +\\[(Unskilled|Basic|Skilled|Expert|Master|Grand Master)\\]$" = "grey"; + "^ *[a-z] - +[a-z -]+ +\\[(Unskilled|Basic|Skilled|Expert|Master|Grand Master)\\]$" = "white"; + "^ +\\* +[a-z -]+ +\\[(Unskilled|Basic|Skilled|Expert|Master|Grand Master)\\]$" = "white"; + "^ +# +[a-z -]+ +\\[(Unskilled|Basic|Skilled|Expert|Master|Grand Master)\\]$" = "grey"; + " is empty. Do what?" = "grey"; + "Put something into .*" = "grey"; + "Take something out of .*" = "grey"; + "unicorn horn.*(Unskilled|Basic|Skilled|Expert)" = "grey"; + "Info on what a given key does." = "grey"; + "Full list of keyboard commands." = "grey"; + "altkeyhandler" = "grey"; + "fruit.*\\[" = "grey"; + }; + }; + + 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"; + }; +} +# vim: ts=2 sw=2 et diff --git a/system/maidena.nix b/system/maidena.nix new file mode 100644 index 0000000..7da30b3 --- /dev/null +++ b/system/maidena.nix @@ -0,0 +1,99 @@ +{ + inputs, + config, + pkgs, + lib, + ... +}: +let flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs; +in +{ + # Bootloader + boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/sda"; + + + # Networking + networking.hostName = "maidena"; + networking.networkmanager.enable = true; + services.openssh.enable = true; + + + # l10n and i8n + time.timeZone = "Europe/Riga"; + i18n.defaultLocale = "en_US.UTF-8"; + + + # Editor + programs.neovim = { + enable = true; + viAlias = true; + vimAlias = true; + defaultEditor = true; + }; + + + # Nix + nixpkgs.config.allowUnfree = true; + nix = { + settings = { + experimental-features = [ "nix-command" "flakes" ]; + flake-registry = ""; + nix-path = config.nix.nixPath; + }; + + channel.enable = false; + registry = lib.mapAttrs (_: flake: { inherit flake; }) flakeInputs; + nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs; + }; + + + # Sound TODO + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + # Users + users.mutableUsers = false; + users.users.andrey = { + isNormalUser = true; + initialHashedPassword = "$y$j9T$mGZT4otEkrc94e.Ile.P20$BoxfgxCiacs.tYoEp7S5AjcP.aMUBrsaCJYJkBot635"; + extraGroups = [ "wheel" "cdrom" "networkmanager" "audio" "dialout" ]; + }; + + security.sudo.execWheelOnly = true; + security.sudo.wheelNeedsPassword = false; + + + # Packages + environment.systemPackages = with pkgs; [ + alsa-utils + mpv + ]; + + + # Xorg + services = { + xserver.enable = true; + desktopManager.plasma6.enable = true; + displayManager.sddm = { + enable = true; + wayland.enable = true; + }; + + libinput.touchpad = { + naturalScrolling = true; + disableWhileTyping = false; + tappingDragLock = false; + }; + }; + + + # Something important + system.stateVersion = "24.05"; +} +# vim: ts=2 sw=2 et diff --git a/system/tokishiko.nix b/system/tokishiko.nix new file mode 100644 index 0000000..09be062 --- /dev/null +++ b/system/tokishiko.nix @@ -0,0 +1,106 @@ +{ + inputs, + config, + pkgs, + lib, + ... +}: +let flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs; +in +{ + # Bootloader + boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/sda"; + + + # Networking + networking.hostName = "tokishiko"; + networking.networkmanager.enable = true; + services.openssh.enable = true; + + + # l10n and i8n + time.timeZone = "Europe/Riga"; + i18n.defaultLocale = "en_US.UTF-8"; + + console = { + keyMap = "no"; + }; + + + # Editor + programs.neovim = { + enable = true; + viAlias = true; + vimAlias = true; + defaultEditor = true; + }; + + + # Nix + nixpkgs.config.allowUnfree = true; + nix = { + settings = { + experimental-features = [ "nix-command" "flakes" ]; + flake-registry = ""; + nix-path = config.nix.nixPath; + }; + + channel.enable = false; + registry = lib.mapAttrs (_: flake: { inherit flake; }) flakeInputs; + nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs; + }; + + + # Sound + hardware.pulseaudio.enable = true; + hardware.pulseaudio.support32Bit = true; + + + # Users + users.mutableUsers = false; + users.users.andrey = { + isNormalUser = true; + initialHashedPassword = "$y$j9T$mGZT4otEkrc94e.Ile.P20$BoxfgxCiacs.tYoEp7S5AjcP.aMUBrsaCJYJkBot635"; + extraGroups = [ "wheel" "cdrom" "networkmanager" "audio" "dialout" ]; + }; + + security.sudo.execWheelOnly = true; + security.sudo.wheelNeedsPassword = false; + + + # Packages + environment.systemPackages = with pkgs; [ + alsa-utils + mpv + ]; + + + # Xorg + services = { + xserver = { + enable = true; + + windowManager.awesome.enable = true; + + xkb.layout = "no(nodeadkeys)"; + }; + + displayManager = { + enable = true; + + defaultSession = "none+awesome"; + }; + + libinput.touchpad = { + naturalScrolling = true; + disableWhileTyping = false; + tappingDragLock = false; + }; + }; + + + # Something important + system.stateVersion = "24.05"; +} +# vim: ts=2 sw=2 et