From f140f08bc6c39037958048294fd241a28d8da607 Mon Sep 17 00:00:00 2001 From: Nguyễn Gia Phong Date: Wed, 7 Jul 2021 22:14:22 +0700 Subject: Snapshot config before there're too much I thought I could always make meaningful config msgs. --- .gitignore | 1 - awesome/.config/awesome/rc.lua | 2 +- awesome/.config/awesome/themes/srcery/theme.lua | 2 +- newsboat/.config/newsboat/urls | 6 +- nix/awesome.nix | 39 +++++++++ nix/configuration.nix | 108 ++++++++++++++++++++++++ nix/devel.nix | 34 ++++++++ nix/etc/nixos/awesome.nix | 40 --------- nix/etc/nixos/configuration.nix | 98 --------------------- nix/etc/nixos/devel.nix | 32 ------- nix/etc/nixos/games.nix | 19 ----- nix/etc/nixos/hardware-configuration.nix | 43 ---------- nix/games.nix | 23 +++++ nix/hardware-configuration.nix | 43 ++++++++++ nixos/.Xdefaults | 5 +- ranger/.config/ranger/rc.conf | 2 +- 16 files changed, 258 insertions(+), 239 deletions(-) create mode 100644 nix/awesome.nix create mode 100644 nix/configuration.nix create mode 100644 nix/devel.nix delete mode 100644 nix/etc/nixos/awesome.nix delete mode 100644 nix/etc/nixos/configuration.nix delete mode 100644 nix/etc/nixos/devel.nix delete mode 100644 nix/etc/nixos/games.nix delete mode 100644 nix/etc/nixos/hardware-configuration.nix create mode 100644 nix/games.nix create mode 100644 nix/hardware-configuration.nix diff --git a/.gitignore b/.gitignore index 424f9c7..fd12051 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ .uuid __pycache__ audio/.config/pulse/cookie -nix/etc/nixos/redshift.nix vim/.cache/vim vim/.vim/.netrwhist vim/.vim/plugged diff --git a/awesome/.config/awesome/rc.lua b/awesome/.config/awesome/rc.lua index a204762..0beffe7 100644 --- a/awesome/.config/awesome/rc.lua +++ b/awesome/.config/awesome/rc.lua @@ -791,7 +791,7 @@ client.connect_signal( awful.titlebar.widget.stickybutton(c), awful.titlebar.widget.maximizedbutton(c), awful.titlebar.widget.floatingbutton(c), - layout = wibox.layout.fixed.horizontal + layout = wibox.layout.fixed.horizontal }, {-- Middle {-- Title diff --git a/awesome/.config/awesome/themes/srcery/theme.lua b/awesome/.config/awesome/themes/srcery/theme.lua index baaac50..2161fb4 100644 --- a/awesome/.config/awesome/themes/srcery/theme.lua +++ b/awesome/.config/awesome/themes/srcery/theme.lua @@ -21,7 +21,7 @@ local theme = {} local wd = '~/.config/awesome/themes/srcery/' local function abspath(relative) return wd .. relative end -theme.font = 'Latin Modern Mono Caps 15' +theme.font = 'Latin Modern Mono 15' theme.hotkeys_font = 'Latin Modern Mono Bold 15' theme.hotkeys_description_font = theme.font diff --git a/newsboat/.config/newsboat/urls b/newsboat/.config/newsboat/urls index 7b6e7fc..8137c84 100644 --- a/newsboat/.config/newsboat/urls +++ b/newsboat/.config/newsboat/urls @@ -6,15 +6,17 @@ https://www.fsf.org/static/fsforg/rss/jobs.xml https://ar.al/index.xml https://andrewkelley.me/rss.xml https://tyil.nl/atom.xml -https://andrewshitov.com/feed +https://secluded.site/posts/index.xml https://codesections.com/rss.xml +https://andrewshitov.com/feed https://pgjones.dev/blog/atom.xml https://blog.ganssle.io/feeds/all.atom.xml https://vorpus.org/blog/feeds/atom.xml +https://voussoir.net/writing/writing.atom https://danct12.github.io/feed.xml https://raphlinus.github.io/feed.xml https://www.chrisj.com.au/feeds/posts/default https://feeds.feedburner.com/WolfireGames https://cnx.srht.site/feed.xml -https://huyngo.srht.site/index.xml +https://huyngo.envs.net/index.xml https://node2.feed43.com/7524823728140683.xml diff --git a/nix/awesome.nix b/nix/awesome.nix new file mode 100644 index 0000000..15c7bd3 --- /dev/null +++ b/nix/awesome.nix @@ -0,0 +1,39 @@ +{ pkgs, ... }: + +{ + fonts.fonts = with pkgs; [ julia-mono lmodern ]; + + services = { + autorandr.enable = true; + xserver = { + enable = true; + desktopManager.xterm.enable = false; + displayManager.startx.enable = true; + windowManager.awesome.enable = true; + + layout = "us"; + xkbOptions = "caps:ctrl_modifier,compose:menu"; + libinput.enable = true; # Enable touchpad support. + }; + }; + + i18n = { + defaultLocale = "en_US.UTF-8"; + inputMethod = { + enabled = "ibus"; + ibus.engines = with pkgs.ibus-engines; [ table table-others ]; + }; + }; + + environment.systemPackages = with pkgs; [ + gnome.adwaita-icon-theme gnome.networkmanagerapplet qt5ct + clipbuzz playerctl pulsemixer xclip xdotool + aerc amfora ncdu newsboat ranger ueberzug rxvt-unicode vim_configurable + arandr audacious keynav scrot sigil xorg.xkill zathura + firefox libreoffice nheko transmission-gtk + ]; + + programs.nm-applet.enable = true; + programs.slock.enable = true; + programs.udevil.enable = true; +} diff --git a/nix/configuration.nix b/nix/configuration.nix new file mode 100644 index 0000000..83d28c9 --- /dev/null +++ b/nix/configuration.nix @@ -0,0 +1,108 @@ +# Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running 'nixos-help'). + +{ config, pkgs, ... }: + +{ + imports = [ + ./hardware-configuration.nix + ./awesome.nix + ./devel.nix + ./games.nix + ]; + + # Use the systemd-boot EFI boot loader. + boot.loader = { + efi.canTouchEfiVariables = true; + grub = { + enable = true; + device = "nodev"; + efiSupport = true; + useOSProber = true; + splashImage = null; + }; + }; + + networking = { + hostName = "nix"; + nameservers = [ "9.9.9.11" "149.112.112.11" ]; + networkmanager.enable = true; + + # The global useDHCP flag is deprecated, therefore explicitly set + # to false here. Per-interface useDHCP will be mandatory in the future, + # so this generated config replicates the default behaviour. + useDHCP = false; + interfaces.enp1s0.useDHCP = true; + interfaces.wlp2s0.useDHCP = true; + + # Configure network proxy if necessary + # proxy.default = "http://user:password@proxy:port/"; + # proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Open ports in the firewall. + # firewall.allowedTCPPorts = [ ... ]; + # firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # firewall.enable = false; + + # Overcoming my strange addiction + extraHosts = '' + 127.0.0.1 9gag.com + ''; + }; + + # Set your time zone. + time.timeZone = "Asia/Ho_Chi_Minh"; + + # Select internationalisation properties. + # console = { + # font = "Lat2-Terminus16"; + # keyMap = "us"; + # }; + + users.users.sea = { + isNormalUser = true; + extraGroups = [ "networkmanager" "wheel" ]; + }; + + nix.autoOptimiseStore = true; + environment.systemPackages = with pkgs; [ + htop isync killall oathToolkit rsync stow unzip w3m wget + mpv pavucontrol sent vimiv-qt yacreader youtube-dl + ffmpeg gifski gimp imagemagick inkscape simplescreenrecorder + ]; + + security.rtkit.enable = true; + # List services that you want to enable: + services = { + pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + + # Use the example session manager (no others are packaged yet so this is + # enabled by default, no need to redefine it in your config for now) + # media-session.enable = true; + }; + + printing = { + enable = true; + drivers = with pkgs; [ hplipWithPlugin ]; + }; + + dictd = { + enable = true; + DBs = with pkgs.dictdDBs; [ wiktionary wordnet ]; + }; + }; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "21.05"; # Did you read the comment? +} diff --git a/nix/devel.nix b/nix/devel.nix new file mode 100644 index 0000000..113d966 --- /dev/null +++ b/nix/devel.nix @@ -0,0 +1,34 @@ +{ pkgs, ... }: + +{ + environment.systemPackages = with pkgs; [ + exa fd gitAndTools.gitFull glow jq manpages ripgrep rlwrap + clojure gcc guile julia-stable-bin lua python3 rakudo zig + bintools gdb gnumake leiningen pkg-config python38Packages.pip + groff plantuml texlive.combined.scheme-full + ]; + + programs.mtr.enable = true; + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + + services = { + # openssh.enable = true; + ipfs = { + enable = true; + dataDir = "/data/IPFS"; + }; + + postgresql = { + enable = true; + enableTCPIP = true; + authentication = pkgs.lib.mkOverride 10 '' + local all all trust + host all all ::1/128 trust + host all all 127.0.0.1/32 password + ''; + }; + }; +} diff --git a/nix/etc/nixos/awesome.nix b/nix/etc/nixos/awesome.nix deleted file mode 100644 index dfd526d..0000000 --- a/nix/etc/nixos/awesome.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ pkgs, ... }: - -{ - imports = [ ./redshift.nix ]; - - fonts.fonts = with pkgs; [ lmodern ]; - - services = { - autorandr.enable = true; - xserver = { - enable = true; - displayManager.startx.enable = true; - windowManager.awesome.enable = true; - - layout = "us"; - xkbOptions = "caps:ctrl_modifier,compose:menu"; - libinput.enable = true; # Enable touchpad support. - }; - }; - - i18n = { - defaultLocale = "en_US.UTF-8"; - inputMethod = { - enabled = "ibus"; - ibus.engines = with pkgs.ibus-engines; [ table table-others ]; - }; - }; - - environment.systemPackages = with pkgs; [ - gnome.adwaita-icon-theme qt5ct - gnome.networkmanagerapplet keynav mate.mate-power-manager - clipnotify playerctl pulsemixer xclip xdotool - rxvt_unicode-with-plugins urxvt_autocomplete_all_the_things urxvt_font_size - aerc amfora newsboat ranger ueberzug vim_configurable - arandr audacious firefox gimp nheko scrot xorg.xkill zathura - ]; - - programs.nm-applet.enable = true; - programs.slock.enable = true; -} diff --git a/nix/etc/nixos/configuration.nix b/nix/etc/nixos/configuration.nix deleted file mode 100644 index 2829879..0000000 --- a/nix/etc/nixos/configuration.nix +++ /dev/null @@ -1,98 +0,0 @@ -# Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running 'nixos-help'). - -{ config, pkgs, ... }: - -{ - imports = [ - ./hardware-configuration.nix - ./awesome.nix - ./devel.nix - ./games.nix - ]; - - # Use the systemd-boot EFI boot loader. - boot.loader = { - efi.canTouchEfiVariables = true; - grub = { - enable = true; - device = "nodev"; - efiSupport = true; - useOSProber = true; - splashImage = null; - }; - }; - - networking = { - hostName = "nix"; - nameservers = [ "9.9.9.11" "149.112.112.11" ]; - networkmanager.enable = true; - - # The global useDHCP flag is deprecated, therefore explicitly set - # to false here. Per-interface useDHCP will be mandatory in the future, - # so this generated config replicates the default behaviour. - useDHCP = false; - interfaces.enp1s0.useDHCP = true; - interfaces.wlp2s0.useDHCP = true; - - # Configure network proxy if necessary - # proxy.default = "http://user:password@proxy:port/"; - # proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Open ports in the firewall. - # firewall.allowedTCPPorts = [ ... ]; - # firewall.allowedUDPPorts = [ ... ]; - # Or disable the firewall altogether. - # firewall.enable = false; - }; - - # Set your time zone. - time.timeZone = "Asia/Ho_Chi_Minh"; - - # Select internationalisation properties. - # console = { - # font = "Lat2-Terminus16"; - # keyMap = "us"; - # }; - - users.users.sea = { - isNormalUser = true; - extraGroups = [ "networkmanager" "wheel" ]; - }; - - environment.systemPackages = with pkgs; [ - htop isync killall oathToolkit rsync stow w3m wget - ffmpeg mpv pavucontrol vimiv-qt youtube-dl - ]; - - security.rtkit.enable = true; - # List services that you want to enable: - services = { - pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - jack.enable = true; - - # Use the example session manager (no others are packaged yet so this is - # enabled by default, no need to redefine it in your config for now) - # media-session.enable = true; - }; - - printing.enable = true; - - dictd = { - enable = true; - DBs = with pkgs.dictdDBs; [ wiktionary wordnet ]; - }; - }; - - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - system.stateVersion = "21.05"; # Did you read the comment? -} diff --git a/nix/etc/nixos/devel.nix b/nix/etc/nixos/devel.nix deleted file mode 100644 index e554da9..0000000 --- a/nix/etc/nixos/devel.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ pkgs, ... }: - -{ - environment.systemPackages = with pkgs; [ - exa fd git glow ripgrep rlwrap - clojure guile julia-stable leiningen lua python3 rakudo zig - texlive.combined.scheme-tetex - ]; - - programs.mtr.enable = true; - programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; - }; - - services = { - # openssh.enable = true; - ipfs = { - enable = true; - dataDir = "/data/IPFS"; - }; - - postgresql = { - enable = true; - enableTCPIP = true; - authentication = pkgs.lib.mkOverride 10 '' - local all all trust - host all all ::1/128 trust - ''; - }; - }; -} diff --git a/nix/etc/nixos/games.nix b/nix/etc/nixos/games.nix deleted file mode 100644 index 3a48dc4..0000000 --- a/nix/etc/nixos/games.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ config, pkgs, ... }: - -{ - nixpkgs.config.allowUnfree = true; - - environment.systemPackages = with pkgs; [ - _20kly hedgewars globulation2 scorched3d teeworlds # strategy - astromenace chromium-bsu # scrolling - azimuth cdogs-sdl taisei # shmup - bastet moon-buggy n2048 # text - blackshades redeclipse warsow xonotic-glx # fps - blobwars openclonk sienna superTux # platformer - bonzomatic # edu - extremetuxracer gl117 gltron superTuxKart # vehicle - flare freedroidrpg hyperrogue # slash - frozen-bubble gnujump gtetrinet pinball xbill # coffeebreak - neverball orthorobot trackballs # puzzle - ]; -} diff --git a/nix/etc/nixos/hardware-configuration.nix b/nix/etc/nixos/hardware-configuration.nix deleted file mode 100644 index 9ac7c6c..0000000 --- a/nix/etc/nixos/hardware-configuration.nix +++ /dev/null @@ -1,43 +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 = [ (modulesPath + "/installer/scan/not-detected.nix") ]; - - boot.initrd.availableKernelModules = [ - "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" - ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems = { - "/" = { - device = "/dev/disk/by-uuid/34058769-4280-4374-ad92-259554380a9e"; - fsType = "ext4"; - }; - - "/boot" = { - device = "/dev/disk/by-uuid/8EB8-6EDD"; - fsType = "vfat"; - }; - - "/home" = { - device = "/dev/disk/by-uuid/69991f9d-8fec-4b32-8e3e-83d6a2c64257"; - fsType = "ext4"; - }; - - "/data" = { - device = "/dev/disk/by-uuid/02594f2b-d681-49fc-8f4a-0616d44c8987"; - fsType = "ext4"; - }; - }; - - swapDevices = [ - { device = "/dev/disk/by-uuid/6f45a147-3b44-4eb9-8ac3-2201e80cff5e"; } - ]; - - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; -} diff --git a/nix/games.nix b/nix/games.nix new file mode 100644 index 0000000..ec0e2d8 --- /dev/null +++ b/nix/games.nix @@ -0,0 +1,23 @@ +{ config, pkgs, ... }: + +{ + nixpkgs.config.allowUnfree = true; + + environment.systemPackages = with pkgs; [ + _20kly hedgewars globulation2 scorched3d teeworlds # strategy + astromenace chromium-bsu # scrolling + azimuth cdogs-sdl taisei # shmup + bastet moon-buggy n2048 # text + # blackshades redeclipse warsow xonotic-glx # fps + blobwars openclonk sienna superTux # platformer + bonzomatic # edu + extremetuxracer gl117 gltron superTuxKart # vehicle + flare freedroidrpg hyperrogue # slash + frozen-bubble gnujump gtetrinet pinball xbill # coffeebreak + neverball orthorobot trackballs # puzzle + (steam.override { + nativeOnly = true; + extraPkgs = pkgs: [ SDL2_net ]; + }).run gnome.gtk # launcher + ]; +} diff --git a/nix/hardware-configuration.nix b/nix/hardware-configuration.nix new file mode 100644 index 0000000..9ac7c6c --- /dev/null +++ b/nix/hardware-configuration.nix @@ -0,0 +1,43 @@ +# 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 = [ + "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/34058769-4280-4374-ad92-259554380a9e"; + fsType = "ext4"; + }; + + "/boot" = { + device = "/dev/disk/by-uuid/8EB8-6EDD"; + fsType = "vfat"; + }; + + "/home" = { + device = "/dev/disk/by-uuid/69991f9d-8fec-4b32-8e3e-83d6a2c64257"; + fsType = "ext4"; + }; + + "/data" = { + device = "/dev/disk/by-uuid/02594f2b-d681-49fc-8f4a-0616d44c8987"; + fsType = "ext4"; + }; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/6f45a147-3b44-4eb9-8ac3-2201e80cff5e"; } + ]; + + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; +} diff --git a/nixos/.Xdefaults b/nixos/.Xdefaults index 1a3cfc1..b9581ea 100644 --- a/nixos/.Xdefaults +++ b/nixos/.Xdefaults @@ -28,5 +28,8 @@ URxvt.jumpScroll: true URxvt.font: xft:Latin Modern Mono:size=15:autohint=true URxvt.termName: rxvt-unicode-256color -URxvt.perl-ext-common: default,font-size +URxvt.perl-ext-common: default,font-size,autocomplete-ALL-the-things URxvt.font-size.step: 1 +URxvt.keysym.M-C-slash: perl:aAtt:word-complete +URxvt.keysym.M-question: perl:aAtt:fuzzy-complete +URxvt.keysym.M-quotedbl: perl:aAtt:undo diff --git a/ranger/.config/ranger/rc.conf b/ranger/.config/ranger/rc.conf index 79e8c14..7ce756e 100644 --- a/ranger/.config/ranger/rc.conf +++ b/ranger/.config/ranger/rc.conf @@ -57,7 +57,7 @@ set automatically_count_files true set open_all_images true # Be aware of version control systems and display information. -set vcs_aware true +set vcs_aware false # State of the four backends git, hg, bzr, svn. The possible states are # disabled, local (only show local info), enabled (show local and remote -- cgit 1.4.1