a lot of shuffling things around

This commit is contained in:
ChaotiCryptidz 2021-12-26 14:07:09 +00:00
parent a98539b9cc
commit 5d5ca6ef1c
35 changed files with 282 additions and 338 deletions

View file

@ -7,6 +7,5 @@
deploy-rs.url = "github:serokell/deploy-rs";
};
outputs = { ... }@inputs: import ./outputs.nix inputs;
}

View file

@ -1,7 +1,7 @@
{ ... }: {
programs.zsh = {
enable = true;
ohMyZsh = {
oh-my-zsh = {
enable = true;
theme = "afowler";
plugins = [ ];

View file

@ -1,5 +1,5 @@
{ pkgs, ... }: {
environment.systemPackages = with pkgs; [
home.packages = with pkgs; [
zip
unzip
p7zip

View file

@ -4,10 +4,6 @@
package = pkgs.gitAndTools.gitFull;
userName = "ChaotiCryptidz";
userEmail = "chaoticryptidz@owo.monster";
extraConfig = {
credential = {
helper = "store";
};
};
extraConfig = { credential = { helper = "store"; }; };
};
}

12
home/gaming/gaming.nix Normal file
View file

@ -0,0 +1,12 @@
{ config, pkgs, ... }: {
home.packages = with pkgs; [
steam
lutris
mgba
nestopia
snes9x-gtk
melonDS
sixpair
xboxdrv
];
}

View file

@ -3,12 +3,6 @@
{
programs.vscode = {
enable = true;
extensions = with pkgs; [
vscode-extensions.bbenoist.nix
vscode-extensions.brettm12345.nixfmt-vscode
vscode-extensions.tiehuis.zig
vscode-extensions.golang.go
];
userSettings = {
"window.zoomLevel" = -1;
"editor.fontSize" = 24;
@ -19,7 +13,6 @@
"markdown.preview.fontFamily" = "'Comic Code'";
"terminal.integrated.fontFamily" = "'Comic Code'";
"files.autoSave" = "afterDelay";
"[nix]" = { "editor.defaultFormatter" = "brettm12345.nixfmt-vscode"; };
};
};
}

View file

@ -0,0 +1,6 @@
{ config, pkgs, ... }:
{
home.packages = with pkgs; [ go gopls go-outline goimports ];
programs.vscode.extensions = with pkgs; [ vscode-extensions.golang.go ];
}

View file

@ -0,0 +1,14 @@
{ config, pkgs, ... }:
{
home.packages = with pkgs; [ nixfmt ];
programs.vscode.extensions = with pkgs; [
vscode-extensions.bbenoist.nix
vscode-extensions.brettm12345.nixfmt-vscode
];
programs.vscode.userSettings."[nix]" = {
"editor.defaultFormatter" = "brettm12345.nixfmt-vscode";
};
}

View file

@ -0,0 +1,6 @@
{ config, pkgs, ... }:
{
home.packages = with pkgs; [ zig zls ];
programs.vscode.extensions = with pkgs; [ vscode-extensions.tiehuis.zig ];
}

View file

@ -1,9 +1,8 @@
{ pkgs, ... }: {
environment.systemPackages = with pkgs; [
home.packages = with pkgs; [
binwalk
file
binutils # strings
diffoscope
];
}

View file

@ -35,20 +35,12 @@
GPG_TTY \
NIX_PATH \
SHLVL
systemctl --user import-environment
#exec systemctl --user start sway.service
exec env --unset=SHLVL systemd-cat -t sway -- sway
fi
'';
programs.waybar = {
programs.waybar = {
enable = true;
# style = ''
# * {
# font-family: Iosevka;
# }
# '';
settings = [{
position = "bottom";
@ -62,16 +54,11 @@ programs.waybar = {
enable = true;
wrapperFeatures.base = true;
wrapperFeatures.gtk = 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";
@ -86,16 +73,10 @@ programs.waybar = {
];
}
{
command = "${pkgs.waybar}/bin/waybar";
}
{ command = "${pkgs.waybar}/bin/waybar"; }
];
input = {
"*" = {
xkb_layout = "gb";
};
};
input = { "*" = { xkb_layout = "gb"; }; };
fonts = {
names = [ "Comic Code" ];
@ -107,15 +88,17 @@ programs.waybar = {
startup = [
# gets blueman applet working for some reason
{ command = "dbus-update-activation-environment DISPLAY"; always = true; }
{ command = "nm-applet"; always = true; }
{
command = "dbus-update-activation-environment DISPLAY";
always = true;
}
{
command = "nm-applet";
always = true;
}
];
seat = {
"*" = {
"xcursor_theme" = "Adwaita 24";
};
};
seat = { "*" = { "xcursor_theme" = "Adwaita 24"; }; };
gaps = {
top = 10;
@ -148,14 +131,20 @@ programs.waybar = {
"${cfg.modifier}+Shift+space" = "floating toggle";
"${cfg.modifier}+space" = "focus mode_toggle";
"XF86AudioRaiseVolume" = "exec pactl set-sink-volume $(pacmd list-sinks |awk '/* index:/{print $3}') +5%";
"XF86AudioLowerVolume" = "exec pactl set-sink-volume $(pacmd list-sinks |awk '/* index:/{print $3}') -5%";
"XF86AudioMute" = "exec pactl set-sink-mute $(pacmd list-sinks |awk '/* index:/{print $3}') toggle";
"XF86AudioMicMute" = "exec pactl set-source-mute $(pacmd list-sources |awk '/* index:/{print $3}') toggle";
"XF86AudioRaiseVolume" =
"exec pactl set-sink-volume $(pacmd list-sinks |awk '/* index:/{print $3}') +5%";
"XF86AudioLowerVolume" =
"exec pactl set-sink-volume $(pacmd list-sinks |awk '/* index:/{print $3}') -5%";
"XF86AudioMute" =
"exec pactl set-sink-mute $(pacmd list-sinks |awk '/* index:/{print $3}') toggle";
"XF86AudioMicMute" =
"exec pactl set-source-mute $(pacmd list-sources |awk '/* index:/{print $3}') toggle";
"XF86MonBrightnessDown" = "exec ${pkgs.light}/bin/light -U 5";
"XF86MonBrightnessUp" = "exec ${pkgs.light}/bin/light -A 5";
"Print" = "exec ${pkgs.grim}/bin/grim -t png - | ${pkgs.wl-clipboard}/bin/wl-copy -t image/png";
"Shift+Print" = "exec ${pkgs.grim}/bin/grim -t png -g \"$(${pkgs.slurp}/bin/slurp -d)\" - | ${pkgs.wl-clipboard}/bin/wl-copy -t image/png";
"Print" =
"exec ${pkgs.grim}/bin/grim -t png - | ${pkgs.wl-clipboard}/bin/wl-copy -t image/png";
"Shift+Print" = ''
exec ${pkgs.grim}/bin/grim -t png -g "$(${pkgs.slurp}/bin/slurp -d)" - | ${pkgs.wl-clipboard}/bin/wl-copy -t image/png'';
"${cfg.modifier}+d" = "exec ${cfg.menu}";
"${cfg.modifier}+f" = "fullscreen";
@ -164,14 +153,12 @@ programs.waybar = {
"${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}";
"${cfg.modifier}+Shift+${workspace}" =
"move container to workspace ${workspace}";
}) [ "1" "2" "3" "4" "5" "6" "7" "8" "9" ]));
};
};
}

View file

@ -1,21 +1,16 @@
{ home-manager, nixpkgs, tree, ... }@inputs:
let
defaultModules = [
home-manager.nixosModules.home-manager
tree.impure.profiles.base
];
defaultModules =
[ home-manager.nixosModules.home-manager tree.impure.profiles.base ];
defaultSpecialArgs = {
tree = tree.impure;
pureTree = tree.pure;
inherit inputs;
};
in
{
in {
lappy = nixpkgs.lib.nixosSystem {
specialArgs = defaultSpecialArgs;
system = "x86_64-linux";
modules = defaultModules ++ [
./lappy.nix
];
modules = defaultModules ++ [ ./lappy.nix ];
};
}

View file

@ -15,18 +15,23 @@
profiles.gaming
];
config.home-manager.users.root = { imports = with tree; [ home.base ]; };
config.home-manager.users.chaoticryptidz = {
imports = with tree; [
home.base
home.gui
home.dev
home.gaming
home.dev
home.network_manager
home.sway
home.vscode
home.reversing
home.programming
home.programming.languages.go
home.programming.languages.nix
];
};
config.networking.hostName = "lappy";
config.time.timeZone = "Europe/London";
config.powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
@ -36,7 +41,8 @@
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
initrd.availableKernelModules =
[ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
kernelModules = [ "kvm-intel" ];
};

View file

@ -8,10 +8,10 @@ let
"profiles/*".functor.enable = true;
"users/*".functor.enable = true;
"home/*".functor.enable = true;
"home/programming/languages/*".functor.enable = true;
};
};
in
{
in {
legacyPackages.tree = tree;
nixosConfigurations = import ./hosts {
nixosSystem = nixpkgs.lib.nixosSystem;

View file

@ -1,7 +1,9 @@
{ fetchzip }: fetchzip {
{ fetchzip }:
fetchzip {
name = "comic-code-1.0";
url = "https://cdn.discordapp.com/attachments/780878889924165652/919700644347142214/COCOD.ZIP";
url =
"https://cdn.discordapp.com/attachments/780878889924165652/919700644347142214/COCOD.ZIP";
sha256 = "sha256-MzEkMAopjpQBk24nRVDAtGNeF6f61XGww4rya2cU8TU=";
postFetch = ''

View file

@ -1,4 +1,5 @@
{ stdenv, fetchFromGitLab, buildGoModule, lib, go }: buildGoModule rec {
{ stdenv, fetchFromGitLab, buildGoModule, lib, go }:
buildGoModule rec {
pname = "gobar";
version = "latest-1";

View file

@ -1,4 +1,5 @@
{ stdenv, fetchFromGitLab, lib, zig }: stdenv.mkDerivation rec {
{ stdenv, fetchFromGitLab, lib, zig }:
stdenv.mkDerivation rec {
pname = "zar";
version = "latest-1";

View file

@ -1,8 +1,4 @@
{ tree, config, lib, pkgs, ... }: {
users.defaultUserShell = pkgs.zsh;
security.sudo.wheelNeedsPassword = lib.mkForce false;
imports = with tree; [
home.base
];
}

View file

@ -1,4 +1,5 @@
{ inputs, tree, config, lib, ... }: with lib; {
{ inputs, tree, config, lib, ... }:
with lib; {
options.home-manager.users = mkOption {
type = types.attrsOf (types.submoduleWith {
modules = [ ];

View file

@ -1,19 +1,14 @@
{ inputs, config, lib, ... }: {
nix = {
nixPath = [
"nixpkgs=${inputs.nixpkgs}"
];
extraOptions = lib.optionalString (lib.versionAtLeast config.nix.package.version "2.4") ''
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
extraOptions = lib.optionalString
(lib.versionAtLeast config.nix.package.version "2.4") ''
experimental-features = nix-command flakes
'';
trustedUsers = [ "root" "@wheel" ];
};
nixpkgs = {
config = {
allowUnfree = true;
};
overlays = [
(import ../../overlay)
];
config = { allowUnfree = true; };
overlays = [ (import ../../overlay) ];
};
}

View file

@ -1,3 +1 @@
{ config, ... }: {
programs.mtr.enable = true;
}
{ config, ... }: { programs.mtr.enable = true; }

View file

@ -1,4 +1,2 @@
{ config, ... }: {
services.localtime.enable = true;
}
{ config, ... }: { services.localtime.enable = true; }

View file

@ -1,6 +1 @@
{ pkgs, ... }: {
environment.systemPackages = with pkgs; [
gdb
lldb
];
}
{ pkgs, ... }: { environment.systemPackages = with pkgs; [ gdb lldb ]; }

View file

@ -1,5 +1 @@
{ pkgs, ... }: {
environment.systemPackages = with pkgs; [
nano
];
}
{ pkgs, ... }: { environment.systemPackages = with pkgs; [ nano ]; }

View file

@ -1,10 +1,3 @@
{ pkgs, ... }: {
environment.systemPackages = with pkgs; [
jq
ripgrep
fd
pv
tmux
socat
];
environment.systemPackages = with pkgs; [ jq ripgrep fd pv tmux socat ];
}

View file

@ -1,7 +1,3 @@
{ pkgs, ... }: {
environment.systemPackages = with pkgs; [
neofetch
inxi
htop
];
environment.systemPackages = with pkgs; [ neofetch inxi htop ];
}

View file

@ -1,14 +0,0 @@
{ pkgs, ... }: {
environment.systemPackages = with pkgs; [
# Nix
nixfmt
# Go
go
gopls
go-outline
goimports
# Zig
zig
zls
];
}

View file

@ -1,7 +1,3 @@
{ pkgs, ... }: {
environment.systemPackages = with pkgs; [
git
darcs
subversion
];
environment.systemPackages = with pkgs; [ git darcs subversion ];
}

View file

@ -1,13 +1,3 @@
{ pkgs, ... }: {
programs.steam.enable = true;
environment.systemPackages = with pkgs; [
steam
lutris
mgba
nestopia
snes9x-gtk
melonDS
sixpair
xboxdrv
];
}

View file

@ -1,8 +1,5 @@
{ config, pkgs, ... }: {
fonts.fonts = with pkgs; [
comic-neue
comic-code
];
fonts.fonts = with pkgs; [ comic-neue comic-code ];
environment.systemPackages = with pkgs; [
tdesktop

View file

@ -2,9 +2,7 @@
networking = {
networkmanager = {
enable = true;
connectionConfig = {
"ipv6.ip6-privacy" = lib.mkForce 0;
};
connectionConfig = { "ipv6.ip6-privacy" = lib.mkForce 0; };
};
};
programs.nm-applet.enable = true;

View file

@ -6,11 +6,7 @@
support32Bit = true;
extraModules = with pkgs; [ pkgs.pulseaudio-modules-bt ];
package = pkgs.pulseaudioFull;
extraConfig = "
load-module module-switch-on-connect
";
extraConfig = "\n load-module module-switch-on-connect\n ";
};
environment.systemPackages = with pkgs; [
pavucontrol
];
environment.systemPackages = with pkgs; [ pavucontrol ];
}

View file

@ -2,6 +2,6 @@
programs.sway.enable = true;
programs.xwayland.enable = true;
services.xserver.enable = true;
systemd.services.display-manager.enable = true;
services.xserver.displayManager.sddm.enable = true;
#systemd.services.display-manager.enable = true;
#services.xserver.displayManager.sddm.enable = true;
}

103
tree.nix
View file

@ -1,4 +1,7 @@
{ lib }: { config, folder, inputs, ... }@args: with lib; let
{ lib }:
{ config, folder, inputs, ... }@args:
with lib;
let
# Made by kat witch (kittywitch)
pureTreeGrab = { base, path }:
let
@ -9,40 +12,37 @@
isDir = entry: _: (isDirectory entry) && !(isHidden entry);
directories = filterAttrs isDir dirContents;
isNixFile = entry: _:
let
result = builtins.match "(.*)\\.nix" entry;
in
result != null && builtins.length result > 0;
let result = builtins.match "(.*)\\.nix" entry;
in result != null && builtins.length result > 0;
nixFiles = filterAttrs isNixFile dirContents;
getPath = entry: "${realPath}/${entry}";
getPaths = entries: mapAttrs'
(n: v:
nameValuePair (removeSuffix ".nix" n) (getPath n)
)
getPaths = entries:
mapAttrs' (n: v: nameValuePair (removeSuffix ".nix" n) (getPath n))
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, ... }: {
type = with types;
attrsOf (submodule ({ name, options, config, ... }: {
options = {
evaluateDefault = mkOption {
type = types.bool;
description = "Replace the contents of this branch or leaf with those provided by the evaluation of default.nix.";
description =
"Replace the contents of this branch or leaf with those provided by the evaluation of default.nix.";
default = false;
};
aliasDefault = mkOption {
type = types.bool;
description = "Replace the contents of this branch or leaf with the default.nix.";
description =
"Replace the contents of this branch or leaf with the default.nix.";
default = false;
};
excludes = mkOption {
@ -70,51 +70,48 @@
};
}));
};
config.treeConfig = {
"*" = { };
};
config.treeConfig = { "*" = { }; };
};
configTree.treeConfig = config;
configTreeModule = (evalModules {
modules = [
configTreeStruct
configTree
];
modules = [ configTreeStruct configTree ];
}).config.treeConfig;
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;
if isAttrs value then
f (path ++ [ name ]) (recurse (path ++ [ name ]) value)
else
f (path ++ [ name ]) value;
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
parentPath = revtail path;
in
getConfig (path ++ singleton "*") (getConfigRecursive parentPath);
processLeaves = tree: config: mapAttrsRecursive
(path: value:
let parentPath = revtail path;
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
processFunctor = prev: prev // {
__functor = self: { ... }: {
imports = attrValues (removeAttrs prev leafConfig.functor.excludes) ++ leafConfig.functor.external;
processFunctor = prev:
prev // {
__functor = self:
{ ... }: {
imports =
attrValues (removeAttrs prev leafConfig.functor.excludes)
++ leafConfig.functor.external;
};
};
processAliasDefault = prev: prev.default;
processDefault = prev: import prev.default (args // {
processDefault = prev:
import prev.default (args // {
inherit lib;
tree = {
prev = removeAttrs prev (singleton "default");
@ -123,21 +120,19 @@
};
});
processExcludes = prev: removeAttrs prev leafConfig.excludes;
processes = optionals (isAttrs value) (
optional (leafConfig.excludes != [ ]) processExcludes
processes = optionals (isAttrs value)
(optional (leafConfig.excludes != [ ]) processExcludes
++ optional leafConfig.evaluateDefault processDefault
++ optional leafConfig.aliasDefault processAliasDefault
++ optional leafConfig.functor.enable processFunctor
);
in
pipe value processes;
in
processConfig path value)
tree;
pureTree = pureTreeGrab { base = folder; path = folder; };
++ optional leafConfig.functor.enable processFunctor);
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;

View file

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