Formatting.

This commit is contained in:
ChaotiCryptidz 2021-12-21 15:26:21 +00:00
parent 729a895f36
commit d89b38c29e
13 changed files with 179 additions and 128 deletions

View file

@ -1,6 +1,6 @@
{ config, ... }: {
users.users.chaoticryptidz = {
isNormalUser = true;
extraGroups = [ "wheel" ];
extraGroups = [ "wheel" "video" "systemd-journal" "plugdev" "vfio" "input" "uinput" ];
};
}

View file

@ -3,9 +3,22 @@
XDG_CURRENT_DESKTOP = "sway";
XDG_SESSION_TYPE = "wayland";
WLR_DRM_DEVICES = "/dev/dri/card0";
SDL_VIDEODRIVER = "wayland";
QT_QPA_PLATFORM = "wayland";
QT_WAYLAND_DISABLE_WINDOWDECORATION = 1;
_JAVA_AWT_WM_NONREPARENTING = 1;
};
home.packages = with pkgs; [ grim slurp wl-clipboard jq wofi wmctrl ];
home.packages = with pkgs; [
grim
slurp
wl-clipboard
jq
wofi
wmctrl
libnotify
light
];
programs.zsh.profileExtra = ''
# If running from tty1 start sway
@ -31,11 +44,13 @@
wayland.windowManager.sway = {
enable = true;
config = let
config =
let
terminal = "${pkgs.kitty}/bin/kitty";
menu = "${pkgs.wofi}/bin/wofi -idbt ${pkgs.kitty}/bin/kitty -p '' -W 25%";
cfg = config.wayland.windowManager.sway.config;
in {
in
{
bars = [
{
position = "top";
@ -65,6 +80,12 @@
{ command = "systemctl --user restart mako"; always = true; }
];
seat = {
"*" = {
"xcursor_theme" = "Adwaita 24";
};
};
gaps = {
top = 10;
bottom = 10;
@ -112,14 +133,14 @@
"${cfg.modifier}+Shift+c" = "reload";
"${cfg.modifier}+r" = "mode resize";
} // (lib.foldl lib.recursiveUpdate {} (map (workspace: {
} // (lib.foldl lib.recursiveUpdate { } (map
(workspace: {
"${cfg.modifier}+${workspace}" = "workspace ${workspace}";
"${cfg.modifier}+Shift+${workspace}" = "move container to workspace ${workspace}";
}) [ "1" "2" "3" "4" "5" "6" "7" "8" "9" ]));
};
wrapperFeatures.gtk = true;
extraConfig = ''
seat seat0 xcursor_theme breeze_cursors 20
bindswitch --reload --locked lid:on output eDP-1 disable
bindswitch --reload --locked lid:off output eDP-1 enable
'';

View file

@ -1,4 +1,5 @@
{ home-manager, nixpkgs, tree, ... }@inputs: let
{ home-manager, nixpkgs, tree, ... }@inputs:
let
defaultModules = [
home-manager.nixosModules.home-manager
tree.impure.profiles.base
@ -8,7 +9,8 @@
pureTree = tree.pure;
inherit inputs;
};
in {
in
{
lappy = nixpkgs.lib.nixosSystem {
specialArgs = defaultSpecialArgs;
system = "x86_64-linux";

View file

@ -1,4 +1,5 @@
{ nixpkgs, home-manager, ... }@inputs: let
{ nixpkgs, home-manager, ... }@inputs:
let
mkTree = import ./tree.nix { inherit (nixpkgs) lib; };
tree = mkTree {
inherit inputs;
@ -9,7 +10,8 @@
"home/*".functor.enable = true;
};
};
in {
in
{
legacyPackages.tree = tree;
nixosConfigurations = import ./hosts {
nixosSystem = nixpkgs.lib.nixosSystem;

View file

@ -6,5 +6,9 @@
wget
jq
ripgrep
fd
htop
dig
nixpkgs-fmt
];
}

View file

@ -1,28 +1,36 @@
{ lib }: { config, folder, inputs, ... }@args: with lib; let
# Made by kat witch (kittywitch)
pureTreeGrab = { base, path }: let
pureTreeGrab = { base, path }:
let
realPath = toString path;
dirContents = builtins.readDir path;
isDirectory = entry: dirContents."${entry}" == "directory";
isHidden = entry: hasPrefix "." entry;
isDir = entry: _: (isDirectory entry) && !(isHidden entry);
directories = filterAttrs isDir dirContents;
isNixFile = entry: _: let
isNixFile = entry: _:
let
result = builtins.match "(.*)\\.nix" entry;
in result != null && builtins.length result > 0;
in
result != null && builtins.length result > 0;
nixFiles = filterAttrs isNixFile dirContents;
getPath = entry: "${realPath}/${entry}";
getPaths = entries: mapAttrs' (n: v:
getPaths = entries: mapAttrs'
(n: v:
nameValuePair (removeSuffix ".nix" n) (getPath n)
) entries;
)
entries;
nixFilePaths = getPaths nixFiles;
dirPaths = getPaths directories;
recursedPaths = mapAttrs (_: fullPath: pureTreeGrab {
recursedPaths = mapAttrs
(_: fullPath: pureTreeGrab {
inherit base;
path = fullPath;
}) dirPaths;
})
dirPaths;
contents = recursedPaths // nixFilePaths;
in contents;
in
contents;
configTreeStruct = { config, ... }: {
options.treeConfig = mkOption {
type = with types; attrsOf (submodule ({ name, options, config, ... }: {
@ -73,23 +81,33 @@
configTree
];
}).config.treeConfig;
mapAttrsRecursive = f: set: let
recurse = path: set: let
g = name: value: if isAttrs value
mapAttrsRecursive = f: set:
let
recurse = path: set:
let
g = name: value:
if isAttrs value
then f (path ++ [ name ]) (recurse (path ++ [ name ]) value)
else f (path ++ [ name ]) value;
in mapAttrs g set;
in recurse [] set;
in
mapAttrs g set;
in
recurse [ ] set;
getPathString = path: concatStringsSep "/" path;
getConfig = path: default: configTreeModule.${getPathString path} or default;
revtail = path: sublist 0 (length path - 1) path;
getConfigRecursive = path: let
getConfigRecursive = path:
let
parentPath = revtail path;
in getConfig (path ++ singleton "*") (getConfigRecursive parentPath);
processLeaves = tree: config: mapAttrsRecursive (path: value: let
in
getConfig (path ++ singleton "*") (getConfigRecursive parentPath);
processLeaves = tree: config: mapAttrsRecursive
(path: value:
let
pathString = getPathString path;
leafConfig = getConfig path (getConfigRecursive (revtail path));
processConfig = path: value: let
processConfig = path: value:
let
processFunctor = prev: prev // {
__functor = self: { ... }: {
imports = attrValues (removeAttrs prev leafConfig.functor.excludes) ++ leafConfig.functor.external;
@ -111,11 +129,15 @@
++ optional leafConfig.aliasDefault processAliasDefault
++ optional leafConfig.functor.enable processFunctor
);
in pipe value processes;
in processConfig path value) tree;
in
pipe value processes;
in
processConfig path value)
tree;
pureTree = pureTreeGrab { base = folder; path = folder; };
impureTree = processLeaves pureTree configTreeModule;
in {
in
{
config = configTreeModule;
pure = pureTree;
impure = impureTree;