format: apply nixpkgs-fmt

This commit is contained in:
Timothy DeHerrera 2020-07-30 22:17:28 -06:00
parent 14edf3fd19
commit 2369f43398
No known key found for this signature in database
GPG key ID: 8985725DB5B0C122
39 changed files with 319 additions and 242 deletions

View file

@ -1,14 +1,12 @@
# WARN: this file will get overwritten by $ cachix use <name> # WARN: this file will get overwritten by $ cachix use <name>
{ pkgs, lib, ... }: { pkgs, lib, ... }:
let let
folder = ./cachix; folder = ./cachix;
toImport = name: value: folder + ("/" + name); toImport = name: value: folder + ("/" + name);
filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key; filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key;
imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder)); imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder));
in { in
{
inherit imports; inherit imports;
nix.binaryCaches = ["https://cache.nixos.org/"]; nix.binaryCaches = [ "https://cache.nixos.org/" ];
} }

View file

@ -1,4 +1,3 @@
{ {
nix = { nix = {
binaryCaches = [ binaryCaches = [
@ -9,4 +8,3 @@
]; ];
}; };
} }

View file

@ -7,16 +7,18 @@ let
hostname = lib.fileContents /etc/hostname; hostname = lib.fileContents /etc/hostname;
host = "/etc/nixos/hosts/${hostname}.nix"; host = "/etc/nixos/hosts/${hostname}.nix";
config = if (builtins.pathExists host) then config =
[ host ] if (builtins.pathExists host) then
else [ host ]
[ /etc/nixos/hosts/NixOS.nix ]; else
in { [ /etc/nixos/hosts/NixOS.nix ];
in
{
imports = (import ./modules/list.nix) ++ [ imports = (import ./modules/list.nix) ++ [
"${ "${
builtins.fetchTarball builtins.fetchTarball
"https://github.com/rycee/home-manager/archive/master.tar.gz" "https://github.com/rycee/home-manager/archive/master.tar.gz"
}/nixos" }/nixos"
/etc/nixos/profiles/core.nix /etc/nixos/profiles/core.nix
] ++ config; ] ++ config;
@ -27,8 +29,11 @@ in {
"nixpkgs-overlays=/etc/nixos/overlays" "nixpkgs-overlays=/etc/nixos/overlays"
]; ];
nixpkgs.overlays = let nixpkgs.overlays =
overlays = map (name: import (./overlays + "/${name}")) let
(attrNames (readDir ./overlays)); overlays = map
in overlays; (name: import (./overlays + "/${name}"))
(attrNames (readDir ./overlays));
in
overlays;
} }

View file

@ -26,7 +26,8 @@
pkgs = pkgImport nixpkgs; pkgs = pkgImport nixpkgs;
unstablePkgs = pkgImport unstable; unstablePkgs = pkgImport unstable;
in { in
{
nixosConfigurations = nixosConfigurations =
import ./hosts (inputs // { inherit system pkgs unstablePkgs utils; }); import ./hosts (inputs // { inherit system pkgs unstablePkgs utils; });
@ -34,27 +35,31 @@
overlay = import ./pkgs; overlay = import ./pkgs;
overlays = let overlays =
overlayDir = ./overlays; let
fullPath = name: overlayDir + "/${name}"; overlayDir = ./overlays;
overlayPaths = map fullPath (attrNames (readDir overlayDir)); fullPath = name: overlayDir + "/${name}";
in pathsToImportedAttrs overlayPaths; overlayPaths = map fullPath (attrNames (readDir overlayDir));
in
pathsToImportedAttrs overlayPaths;
packages."${system}" = self.overlay pkgs pkgs; packages."${system}" = self.overlay pkgs pkgs;
nixosModules = let nixosModules =
# binary cache let
cachix = import ./cachix.nix; # binary cache
cachixAttrs = { inherit cachix; }; cachix = import ./cachix.nix;
cachixAttrs = { inherit cachix; };
# modules # modules
moduleList = import ./modules/list.nix; moduleList = import ./modules/list.nix;
modulesAttrs = pathsToImportedAttrs moduleList; modulesAttrs = pathsToImportedAttrs moduleList;
# profiles # profiles
profilesList = import ./profiles/list.nix; profilesList = import ./profiles/list.nix;
profilesAttrs = { profiles = pathsToImportedAttrs profilesList; }; profilesAttrs = { profiles = pathsToImportedAttrs profilesList; };
in cachixAttrs // modulesAttrs // profilesAttrs; in
cachixAttrs // modulesAttrs // profilesAttrs;
}; };
} }

View file

@ -8,46 +8,49 @@ let
lib.nixosSystem { lib.nixosSystem {
inherit system; inherit system;
modules = let modules =
inherit (home.nixosModules) home-manager; let
inherit (home.nixosModules) home-manager;
core = self.nixosModules.profiles.core; core = self.nixosModules.profiles.core;
global = { global = {
networking.hostName = hostName; networking.hostName = hostName;
nix.nixPath = [ nix.nixPath = [
"nixpkgs=${nixpkgs}" "nixpkgs=${nixpkgs}"
"nixos-config=/etc/nixos/configuration.nix" "nixos-config=/etc/nixos/configuration.nix"
"nixpkgs-overlays=/etc/nixos/overlays" "nixpkgs-overlays=/etc/nixos/overlays"
]; ];
nixpkgs = { inherit pkgs; }; nixpkgs = { inherit pkgs; };
nix.registry = { nix.registry = {
nixpkgs.flake = nixpkgs; nixpkgs.flake = nixpkgs;
nixflk.flake = self; nixflk.flake = self;
master.flake = unstable; master.flake = unstable;
};
}; };
};
unstables = { unstables = {
systemd.package = unstablePkgs.systemd; systemd.package = unstablePkgs.systemd;
nixpkgs.overlays = [ nixpkgs.overlays = [
(final: prev: (final: prev:
with unstablePkgs; { with unstablePkgs; {
inherit starship element-desktop discord signal-desktop mpv inherit starship element-desktop discord signal-desktop mpv
dhall; dhall;
}) }
]; )
}; ];
};
local = import "${toString ./.}/${hostName}.nix"; local = import "${toString ./.}/${hostName}.nix";
# Everything in `./modules/list.nix`. # Everything in `./modules/list.nix`.
flakeModules = flakeModules =
attrValues (removeAttrs self.nixosModules [ "profiles" ]); attrValues (removeAttrs self.nixosModules [ "profiles" ]);
in flakeModules ++ [ core global local home-manager unstables ]; in
flakeModules ++ [ core global local home-manager unstables ];
}; };
@ -55,4 +58,5 @@ let
dir = ./.; dir = ./.;
_import = config; _import = config;
}; };
in hosts in
hosts

View file

@ -13,18 +13,21 @@ let
# Generate an attribute set by mapping a function over a list of values. # Generate an attribute set by mapping a function over a list of values.
genAttrs' = values: f: listToAttrs (map f values); genAttrs' = values: f: listToAttrs (map f values);
in { in
{
inherit mapFilterAttrs genAttrs'; inherit mapFilterAttrs genAttrs';
recImport = { dir, _import ? base: import "${dir}/${base}.nix" }: recImport = { dir, _import ? base: import "${dir}/${base}.nix" }:
mapFilterAttrs (_: v: v != null) (n: v: mapFilterAttrs
if n != "default.nix" && hasSuffix ".nix" n && v == "regular" (_: v: v != null)
(n: v:
if n != "default.nix" && hasSuffix ".nix" n && v == "regular"
then
let name = removeSuffix ".nix" n; in nameValuePair (name) (_import name)
then else
let name = removeSuffix ".nix" n; in nameValuePair (name) (_import name) nameValuePair ("") (null))
(readDir dir);
else
nameValuePair ("") (null)) (readDir dir);
# Convert a list to file paths to attribute set # Convert a list to file paths to attribute set
# that has the filenames stripped of nix extension as keys # that has the filenames stripped of nix extension as keys

View file

@ -8,7 +8,8 @@ let
cmdline = '' cmdline = ''
ibrs noibpb nopti nospectre_v2 nospectre_v1 l1tf=off nospec_store_bypass_disable no_stf_barrier mds=off tsx=on tsx_async_abort=off mitigations=off ibrs noibpb nopti nospectre_v2 nospectre_v1 l1tf=off nospec_store_bypass_disable no_stf_barrier mds=off tsx=on tsx_async_abort=off mitigations=off
''; '';
in { in
{
options = { options = {
security.mitigations.disable = mkOption { security.mitigations.disable = mkOption {
type = types.bool; type = types.bool;

View file

@ -1,9 +1,9 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
with lib; with lib;
let cfg = config.services.gamemode; let cfg = config.services.gamemode;
in { in
{
options.services.gamemode = { options.services.gamemode = {
enable = mkOption { enable = mkOption {
type = types.bool; type = types.bool;

View file

@ -1,9 +1,9 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
with lib; with lib;
let cfg = config.services.wii-u-gc-adapter; let cfg = config.services.wii-u-gc-adapter;
in { in
{
options = { options = {
services.wii-u-gc-adapter = { services.wii-u-gc-adapter = {
enable = mkOption { enable = mkOption {

View file

@ -4,7 +4,8 @@ let
cfg = config.services.qbittorrent; cfg = config.services.qbittorrent;
configDir = "${cfg.dataDir}/.config"; configDir = "${cfg.dataDir}/.config";
openFilesLimit = 4096; openFilesLimit = 4096;
in { in
{
options.services.qbittorrent = { options.services.qbittorrent = {
enable = mkOption { enable = mkOption {
type = types.bool; type = types.bool;

View file

@ -1,9 +1,9 @@
{ pkgs, lib, config, ... }: { pkgs, lib, config, ... }:
with lib; with lib;
let cfg = config.services.xserver.windowManager.steam; let cfg = config.services.xserver.windowManager.steam;
in { in
{
options = { options = {
services.xserver.windowManager.steam = { services.xserver.windowManager.steam = {
enable = mkEnableOption "steam"; enable = mkEnableOption "steam";

View file

@ -1,5 +1,6 @@
let version = "1.6.0"; let version = "1.6.0";
in final: prev: { in
final: prev: {
pcsx2 = prev.pcsx2.overrideAttrs (o: { pcsx2 = prev.pcsx2.overrideAttrs (o: {
inherit version; inherit version;
src = prev.fetchFromGitHub { src = prev.fetchFromGitHub {

View file

@ -1,5 +1,6 @@
let version = "1.8.9"; let version = "1.8.9";
in final: prev: { in
final: prev: {
retroarchBare = prev.retroarchBare.overrideAttrs (o: { retroarchBare = prev.retroarchBare.overrideAttrs (o: {
inherit version; inherit version;

View file

@ -1,4 +1,3 @@
final: prev: { final: prev: {
slock = prev.slock.overrideAttrs slock = prev.slock.overrideAttrs (o: { patches = [ ../pkgs/misc/screensavers/slock/window_name.patch ]; });
(o: { patches = [ ../pkgs/misc/screensavers/slock/window_name.patch ]; });
} }

View file

@ -1,6 +1,7 @@
{ stdenv, fetchFromGitHub, ... }: { stdenv, fetchFromGitHub, ... }:
let version = "0.1.5"; let version = "0.1.5";
in stdenv.mkDerivation { in
stdenv.mkDerivation {
pname = "sddm-chili"; pname = "sddm-chili";
inherit version; inherit version;

View file

@ -1,5 +1,17 @@
{ stdenv, fetchFromGitHub, libudev, SDL, SDL_image, libXdamage, libXcomposite { stdenv
, libXrender, libXext, libXxf86vm, pkgconfig, autoreconfHook, gnumake }: , fetchFromGitHub
, libudev
, SDL
, SDL_image
, libXdamage
, libXcomposite
, libXrender
, libXext
, libXxf86vm
, pkgconfig
, autoreconfHook
, gnumake
}:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "steamcompmgr"; name = "steamcompmgr";

View file

@ -1,5 +1,6 @@
let version = "2.0.0"; let version = "2.0.0";
in { stdenv, fetchzip }: in
{ stdenv, fetchzip }:
stdenv.mkDerivation { stdenv.mkDerivation {
pname = "dejavu-nerdfont"; pname = "dejavu-nerdfont";

View file

@ -1,6 +1,7 @@
{ stdenv, meson, ninja, fetchFromGitHub, ... }: { stdenv, meson, ninja, fetchFromGitHub, ... }:
let version = "r50"; let version = "r50";
in stdenv.mkDerivation { in
stdenv.mkDerivation {
pname = "libinih"; pname = "libinih";
inherit version; inherit version;

View file

@ -1,6 +1,16 @@
let version = "1.5.1"; let version = "1.5.1";
in { stdenv, meson, ninja, polkit, pkgconfig, systemd, dbus, libinih in
, fetchFromGitHub, ... }: { stdenv
, meson
, ninja
, polkit
, pkgconfig
, systemd
, dbus
, libinih
, fetchFromGitHub
, ...
}:
stdenv.mkDerivation { stdenv.mkDerivation {
pname = "gamemode"; pname = "gamemode";

View file

@ -1,6 +1,7 @@
{ stdenv, fetchFromGitHub }: { stdenv, fetchFromGitHub }:
let version = "0e87bd8"; let version = "0e87bd8";
in stdenv.mkDerivation { in
stdenv.mkDerivation {
pname = "pure"; pname = "pure";
inherit version; inherit version;

View file

@ -5,7 +5,8 @@ let
inherit (builtins) readFile toFile; inherit (builtins) readFile toFile;
init = toFile "init.sh" "${readFile ./init.sh}"; init = toFile "init.sh" "${readFile ./init.sh}";
in buildRustPackage { in
buildRustPackage {
pname = "purs"; pname = "purs";
version = "0.1.0"; version = "0.1.0";

View file

@ -1,7 +1,8 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let inherit (lib) fileContents; let inherit (lib) fileContents;
in { in
{
nix.package = pkgs.nixFlakes; nix.package = pkgs.nixFlakes;
nix.systemFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ]; nix.systemFeatures = [ "nixos-test" "benchmark" "big-parallel" "kvm" ];
@ -38,7 +39,8 @@ in {
shellAliases = shellAliases =
let ifSudo = lib.mkIf config.security.sudo.enable; let ifSudo = lib.mkIf config.security.sudo.enable;
in { in
{
# quick cd # quick cd
".." = "cd .."; ".." = "cd ..";
"..." = "cd ../.."; "..." = "cd ../..";

View file

@ -1,42 +1,47 @@
{ pkgs, ... }: { pkgs, ... }:
let inherit (pkgs) python3Packages; let inherit (pkgs) python3Packages;
in { in
environment.systemPackages = let {
packages = pythonPackages: environment.systemPackages =
with pythonPackages; [ let
numpy packages = pythonPackages:
pandas with pythonPackages; [
ptpython numpy
requests pandas
scipy ptpython
]; requests
scipy
];
python = pkgs.python3.withPackages packages; python = pkgs.python3.withPackages packages;
in [ python ]; in
[ python ];
environment.sessionVariables = { environment.sessionVariables = {
PYTHONSTARTUP = let PYTHONSTARTUP =
startup = pkgs.writers.writePython3 "ptpython.py" { let
libraries = with python3Packages; [ ptpython ]; startup = pkgs.writers.writePython3 "ptpython.py"
} '' {
from __future__ import unicode_literals libraries = with python3Packages; [ ptpython ];
} ''
from __future__ import unicode_literals
from pygments.token import Token from pygments.token import Token
from ptpython.layout import CompletionVisualisation from ptpython.layout import CompletionVisualisation
import sys import sys
${builtins.readFile ./ptconfig.py} ${builtins.readFile ./ptconfig.py}
try: try:
from ptpython.repl import embed from ptpython.repl import embed
except ImportError: except ImportError:
print("ptpython is not available: falling back to standard prompt") print("ptpython is not available: falling back to standard prompt")
else: else:
sys.exit(embed(globals(), locals(), configure=configure)) sys.exit(embed(globals(), locals(), configure=configure))
''; '';
in "${startup}"; in
"${startup}";
}; };
} }

View file

@ -5,10 +5,12 @@ let
inherit (lib) removePrefix; inherit (lib) removePrefix;
pluginConf = plugins: pluginConf = plugins:
concatStringsSep "\n\n" (map (plugin: concatStringsSep "\n\n" (map
let name = removePrefix "tmuxplugin-" plugin.pname; (plugin:
in "run-shell ${plugin}/share/tmux-plugins/${name}/${name}.tmux") let name = removePrefix "tmuxplugin-" plugin.pname;
plugins); in "run-shell ${plugin}/share/tmux-plugins/${name}/${name}.tmux")
plugins
);
plugins = with pkgs.tmuxPlugins; [ plugins = with pkgs.tmuxPlugins; [
copycat copycat
@ -17,7 +19,8 @@ let
yank yank
vim-tmux-navigator vim-tmux-navigator
]; ];
in { in
{
environment.shellAliases = { tx = "tmux new-session -A -s $USER"; }; environment.shellAliases = { tx = "tmux new-session -A -s $USER"; };
programs.tmux = { programs.tmux = {

View file

@ -4,22 +4,27 @@ let
inherit (lib) fileContents; inherit (lib) fileContents;
in { in
{
users.defaultUserShell = pkgs.zsh; users.defaultUserShell = pkgs.zsh;
environment = { environment = {
sessionVariables = let fd = "${pkgs.fd}/bin/fd -H"; sessionVariables =
in { let fd = "${pkgs.fd}/bin/fd -H";
BAT_PAGER = "less"; in
SKIM_ALT_C_COMMAND = let {
alt_c_cmd = pkgs.writeScriptBin "cdr-skim.zsh" '' BAT_PAGER = "less";
#!${pkgs.zsh}/bin/zsh SKIM_ALT_C_COMMAND =
${fileContents ./cdr-skim.zsh} let
''; alt_c_cmd = pkgs.writeScriptBin "cdr-skim.zsh" ''
in "${alt_c_cmd}/bin/cdr-skim.zsh"; #!${pkgs.zsh}/bin/zsh
SKIM_DEFAULT_COMMAND = fd; ${fileContents ./cdr-skim.zsh}
SKIM_CTRL_T_COMMAND = fd; '';
}; in
"${alt_c_cmd}/bin/cdr-skim.zsh";
SKIM_DEFAULT_COMMAND = fd;
SKIM_CTRL_T_COMMAND = fd;
};
shellAliases = { shellAliases = {
cat = "${pkgs.bat}/bin/bat"; cat = "${pkgs.bat}/bin/bat";
@ -84,58 +89,62 @@ in {
eval "$(${pkgs.starship}/bin/starship init zsh)" eval "$(${pkgs.starship}/bin/starship init zsh)"
''; '';
interactiveShellInit = let interactiveShellInit =
zshrc = fileContents ./zshrc; let
zshrc = fileContents ./zshrc;
sources = with pkgs; [ sources = with pkgs; [
./cdr.zsh ./cdr.zsh
"${skim}/share/skim/completion.zsh" "${skim}/share/skim/completion.zsh"
"${oh-my-zsh}/share/oh-my-zsh/plugins/sudo/sudo.plugin.zsh" "${oh-my-zsh}/share/oh-my-zsh/plugins/sudo/sudo.plugin.zsh"
"${oh-my-zsh}/share/oh-my-zsh/plugins/extract/extract.plugin.zsh" "${oh-my-zsh}/share/oh-my-zsh/plugins/extract/extract.plugin.zsh"
"${zsh-you-should-use}/share/zsh/plugins/you-should-use/you-should-use.plugin.zsh" "${zsh-you-should-use}/share/zsh/plugins/you-should-use/you-should-use.plugin.zsh"
"${zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" "${zsh-syntax-highlighting}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
"${zsh-history-substring-search}/share/zsh-history-substring-search/zsh-history-substring-search.zsh" "${zsh-history-substring-search}/share/zsh-history-substring-search/zsh-history-substring-search.zsh"
]; ];
source = map (source: "source ${source}") sources; source = map (source: "source ${source}") sources;
functions = pkgs.stdenv.mkDerivation { functions = pkgs.stdenv.mkDerivation {
name = "zsh-functions"; name = "zsh-functions";
src = ./functions; src = ./functions;
ripgrep = "${pkgs.ripgrep}"; ripgrep = "${pkgs.ripgrep}";
man = "${pkgs.man}"; man = "${pkgs.man}";
exa = "${pkgs.exa}"; exa = "${pkgs.exa}";
installPhase = let basename = "\${file##*/}"; installPhase =
in '' let basename = "\${file##*/}";
mkdir $out in
''
mkdir $out
for file in $src/*; do for file in $src/*; do
substituteAll $file $out/${basename} substituteAll $file $out/${basename}
chmod 755 $out/${basename} chmod 755 $out/${basename}
done done
''; '';
}; };
plugins = concatStringsSep "\n" ([ plugins = concatStringsSep "\n" ([
"${pkgs.any-nix-shell}/bin/any-nix-shell zsh --info-right | source /dev/stdin" "${pkgs.any-nix-shell}/bin/any-nix-shell zsh --info-right | source /dev/stdin"
] ++ source); ] ++ source);
in '' in
${plugins} ''
${plugins}
fpath+=( ${functions} ) fpath+=( ${functions} )
autoload -Uz ${functions}/*(:t) autoload -Uz ${functions}/*(:t)
${zshrc} ${zshrc}
eval "$(${pkgs.direnv}/bin/direnv hook zsh)" eval "$(${pkgs.direnv}/bin/direnv hook zsh)"
eval $(${pkgs.gitAndTools.hub}/bin/hub alias -s) eval $(${pkgs.gitAndTools.hub}/bin/hub alias -s)
source ${pkgs.skim}/share/skim/key-bindings.zsh source ${pkgs.skim}/share/skim/key-bindings.zsh
# needs to remain at bottom so as not to be overwritten # needs to remain at bottom so as not to be overwritten
bindkey jj vi-cmd-mode bindkey jj vi-cmd-mode
''; '';
}; };
} }

View file

@ -1,6 +1,7 @@
{ pkgs, ... }: { pkgs, ... }:
let inherit (builtins) readFile; let inherit (builtins) readFile;
in { in
{
imports = [ ./sway ../develop ./xmonad ../networkmanager ../im ]; imports = [ ./sway ../develop ./xmonad ../networkmanager ../im ];
hardware.opengl.enable = true; hardware.opengl.enable = true;
@ -35,16 +36,18 @@ in {
# Theme settings # Theme settings
QT_QPA_PLATFORMTHEME = "gtk2"; QT_QPA_PLATFORMTHEME = "gtk2";
GTK2_RC_FILES = let GTK2_RC_FILES =
gtk = '' let
gtk-icon-theme-name="Papirus" gtk = ''
gtk-cursor-theme-name="Adwaita" gtk-icon-theme-name="Papirus"
''; gtk-cursor-theme-name="Adwaita"
in [ '';
("${pkgs.writeText "iconrc" "${gtk}"}") in
"${pkgs.adapta-gtk-theme}/share/themes/Adapta/gtk-2.0/gtkrc" [
"${pkgs.gnome3.gnome-themes-extra}/share/themes/Adwaita/gtk-2.0/gtkrc" ("${pkgs.writeText "iconrc" "${gtk}"}")
]; "${pkgs.adapta-gtk-theme}/share/themes/Adapta/gtk-2.0/gtkrc"
"${pkgs.gnome3.gnome-themes-extra}/share/themes/Adwaita/gtk-2.0/gtkrc"
];
}; };
systemPackages = with pkgs; [ systemPackages = with pkgs; [

View file

@ -1,6 +1,7 @@
{ pkgs, ... }: { pkgs, ... }:
let inherit (pkgs) alsaUtils bash gnugrep volnoti; let inherit (pkgs) alsaUtils bash gnugrep volnoti;
in pkgs.writeScript "volnoti.sh" '' in
pkgs.writeScript "volnoti.sh" ''
#!${bash}/bin/bash #!${bash}/bin/bash
declare -i current=$(${alsaUtils}/bin/amixer get Master | ${gnugrep}/bin/grep -m1 -Po "[0-9]+(?=%)") declare -i current=$(${alsaUtils}/bin/amixer get Master | ${gnugrep}/bin/grep -m1 -Po "[0-9]+(?=%)")

View file

@ -1,16 +1,19 @@
{ pkgs, ... }: { pkgs, ... }:
let inherit (builtins) readFile; let inherit (builtins) readFile;
in { in
{
sound.enable = true; sound.enable = true;
environment = { environment = {
etc."xdg/qutebrowser/config.py".text = let mpv = "${pkgs.mpv}/bin/mpv"; etc."xdg/qutebrowser/config.py".text =
in '' let mpv = "${pkgs.mpv}/bin/mpv";
${readFile ./config.py} in
''
${readFile ./config.py}
config.bind(',m', 'hint links spawn -d ${mpv} {hint-url}') config.bind(',m', 'hint links spawn -d ${mpv} {hint-url}')
config.bind(',v', 'spawn -d ${mpv} {url}') config.bind(',v', 'spawn -d ${mpv} {url}')
''; '';
sessionVariables.BROWSER = "qute"; sessionVariables.BROWSER = "qute";

View file

@ -3,7 +3,8 @@ let
inherit (builtins) readFile; inherit (builtins) readFile;
inherit (config.hardware) pulseaudio; inherit (config.hardware) pulseaudio;
in { in
{
imports = [ ../qutebrowser ]; imports = [ ../qutebrowser ];
sound.enable = true; sound.enable = true;
@ -38,7 +39,8 @@ in {
environment.etc = { environment.etc = {
"sway/config".text = "sway/config".text =
let volnoti = import ../misc/volnoti.nix { inherit pkgs; }; let volnoti = import ../misc/volnoti.nix { inherit pkgs; };
in '' in
''
set $volume ${volnoti} set $volume ${volnoti}
set $mixer "${pkgs.alsaUtils}/bin/amixer -q set Master" set $mixer "${pkgs.alsaUtils}/bin/amixer -q set Master"

View file

@ -1,6 +1,7 @@
{ autostart, screenshots, pkgs, stoggle, volnoti }: { autostart, screenshots, pkgs, stoggle, volnoti }:
let inherit (pkgs) alsaUtils; let inherit (pkgs) alsaUtils;
in '' in
''
-- Function for fullscreen toggle -- Function for fullscreen toggle
fullToggle :: X () fullToggle :: X ()
fullToggle = do fullToggle = do

View file

@ -13,9 +13,10 @@ let
writeScript "xmonad-touchtoggle" (readFile ./scripts/touchtoggle); writeScript "xmonad-touchtoggle" (readFile ./scripts/touchtoggle);
volnoti = import ../misc/volnoti.nix { inherit pkgs; }; volnoti = import ../misc/volnoti.nix { inherit pkgs; };
in '' in
''
${readFile ./_xmonad.hs} ${readFile ./_xmonad.hs}
${import ./_xmonad.nix { ${import ./_xmonad.nix {
inherit screenshots touchtoggle autostart stoggle pkgs volnoti; inherit screenshots touchtoggle autostart stoggle pkgs volnoti;
}} }}
'' ''

View file

@ -5,4 +5,3 @@
signal-desktop signal-desktop
]; ];
} }

View file

@ -45,16 +45,18 @@
''; '';
services.logind.lidSwitch = "suspend"; services.logind.lidSwitch = "suspend";
nixpkgs.overlays = let nixpkgs.overlays =
light_ov = self: super: { let
light = super.light.overrideAttrs (o: { light_ov = self: super: {
src = self.fetchFromGitHub { light = super.light.overrideAttrs (o: {
owner = "haikarainen"; src = self.fetchFromGitHub {
repo = "light"; owner = "haikarainen";
rev = "ae7a6ebb45a712e5293c7961eed8cceaa4ebf0b6"; repo = "light";
sha256 = "00z9bxrkjpfmfhz9fbf6mjbfqvixx6857mvgmiv01fvvs0lr371n"; rev = "ae7a6ebb45a712e5293c7961eed8cceaa4ebf0b6";
}; sha256 = "00z9bxrkjpfmfhz9fbf6mjbfqvixx6857mvgmiv01fvvs0lr371n";
}); };
}; });
in [ light_ov ]; };
in
[ light_ov ];
} }

View file

@ -33,10 +33,12 @@ let
blacklist = concatStringsSep '' blacklist = concatStringsSep ''
0.0.0.0 '' [ 0.0.0.0 ''
[
"# auto-generated: must be first" "# auto-generated: must be first"
# starts here # starts here
]; ];
in { networking.extraHosts = readFile "${hosts}/etc/hosts"; } in
{ networking.extraHosts = readFile "${hosts}/etc/hosts"; }

View file

@ -2,7 +2,8 @@
let let
inherit (config.services.qbittorrent) port; inherit (config.services.qbittorrent) port;
inherit (lib) mkAfter; inherit (lib) mkAfter;
in { in
{
services.qbittorrent = { services.qbittorrent = {
enable = true; enable = true;
group = "media"; group = "media";

View file

@ -5,4 +5,3 @@
package = pkgs.postgresql_12; package = pkgs.postgresql_12;
}; };
} }

View file

@ -6,4 +6,3 @@
forwardX11 = true; forwardX11 = true;
}; };
} }

View file

@ -7,17 +7,18 @@
# you'll need to add your user to 'libvirtd' group to use virt-manager # you'll need to add your user to 'libvirtd' group to use virt-manager
environment.systemPackages = with pkgs; [ virt-manager ]; environment.systemPackages = with pkgs; [ virt-manager ];
nixpkgs.overlays = let nixpkgs.overlays =
overlay = final: prev: { let
overlay = final: prev: {
# Patch libvirt to use ebtables-legacy # Patch libvirt to use ebtables-legacy
libvirt = if prev.libvirt.version <= "5.4.0" && prev.ebtables.version libvirt =
> "2.0.10-4" then if prev.libvirt.version <= "5.4.0" && prev.ebtables.version
prev.libvirt.overrideAttrs > "2.0.10-4" then
(o: { EBTABLES_PATH = "${final.ebtables}/bin/ebtables-legacy"; }) prev.libvirt.overrideAttrs (o: { EBTABLES_PATH = "${final.ebtables}/bin/ebtables-legacy"; })
else else
prev.libvirt; prev.libvirt;
}; };
in [ overlay ]; in
[ overlay ];
} }

View file

@ -5,7 +5,8 @@ let
buildIso = pkgs.writeShellScriptBin "build-iso" '' buildIso = pkgs.writeShellScriptBin "build-iso" ''
nix build ${configs}.niximg.config.system.build.isoImage $@ nix build ${configs}.niximg.config.system.build.isoImage $@
''; '';
in pkgs.mkShell { in
pkgs.mkShell {
name = "nixflk"; name = "nixflk";
nativeBuildInputs = with pkgs; [ git git-crypt nixFlakes buildIso ]; nativeBuildInputs = with pkgs; [ git git-crypt nixFlakes buildIso ];