This commit is contained in:
dusk 2022-03-09 23:55:02 +03:00
parent 8d07c29d66
commit 8a3b7aaa57
Signed by: dusk
GPG Key ID: 1D8F8FAF2294D6EA
43 changed files with 1585 additions and 1708 deletions

View File

@ -3,10 +3,8 @@
lib,
budUtils,
...
}:
{
bud.cmds =
with pkgs; {
}: {
bud.cmds = with pkgs; {
get = {
writer = budUtils.writeBashWithPaths [nixUnstable git coreutils];
synopsis = "get [DEST]";

View File

@ -3,8 +3,7 @@ let
default = (import ./lib/compat).defaultNix;
ciSystems = ["aarch64-linux" "i686-linux" "x86_64-linux"];
filterSystems = lib.filterAttrs (system: _: lib.elem system ciSystems);
recurseIntoAttrsRecursive =
lib.mapAttrs (_: v:
recurseIntoAttrsRecursive = lib.mapAttrs (_: v:
if lib.isAttrs v
then recurseIntoAttrsRecursive (lib.recurseIntoAttrs v)
else v);
@ -14,4 +13,4 @@ let
default.outputs;
ciDrvs = lib.mapAttrs (_: system: filterSystems system) systemOutputs;
in
(recurseIntoAttrsRecursive ciDrvs) // { shell = import ./shell.nix; }
(recurseIntoAttrsRecursive ciDrvs) // {shell = import ./shell.nix;}

View File

@ -8,11 +8,11 @@
]
},
"locked": {
"lastModified": 1645729578,
"narHash": "sha256-SQEbg+hHG2Q1zU/Oqjj5LK2X/lmjJoBprm4eYORk0UU=",
"lastModified": 1646360966,
"narHash": "sha256-fJ/WHSU45bMJRDqz9yA3B2lwXtW5DKooU+Pzn13GyZI=",
"owner": "kamadorueda",
"repo": "alejandra",
"rev": "08627c847e250b3eb654c6febeffaa0626fa8473",
"rev": "511c3f6a88b6964e1496fb6f441f4ae5e58bd3ea",
"type": "github"
},
"original": {

View File

@ -34,8 +34,7 @@
inputs.nixpkgs.follows = "nixos";
};
};
outputs =
{
outputs = {
self,
digga,
nixos,
@ -46,12 +45,11 @@
rnixLsp,
alejandra,
...
}
@ inputs:
} @ inputs:
digga.lib.mkFlake
{
inherit self inputs;
channelsConfig = { allowUnfree = true; };
channelsConfig = {allowUnfree = true;};
channels = {
nixos = {
imports = [(digga.lib.importOverlays ./overlays)];
@ -71,8 +69,7 @@
prev.remarshal.overrideAttrs
(
old: {
postPatch =
''
postPatch = ''
substituteInPlace pyproject.toml \
--replace "poetry.masonry.api" "poetry.core.masonry.api" \
--replace 'PyYAML = "^5.3"' 'PyYAML = "*"' \
@ -86,12 +83,12 @@
];
};
};
lib = import ./lib { lib = digga.lib // nixos.lib; };
lib = import ./lib {lib = digga.lib // nixos.lib;};
sharedOverlays = [
(
_: prev: {
__dontExport = true;
lib = prev.lib.extend (_: _: { our = self.lib; });
lib = prev.lib.extend (_: _: {our = self.lib;});
}
)
];
@ -101,7 +98,7 @@
channelName = "nixos";
imports = [(digga.lib.importExportableModules ./modules)];
modules = [
{ lib.our = self.lib; }
{lib.our = self.lib;}
digga.nixosModules.bootstrapIso
digga.nixosModules.nixConfig
home.nixosModules.home-manager
@ -117,8 +114,7 @@
users = digga.lib.rakeLeaves ./users;
nixos-hardware = nixos-hardware.nixosModules;
};
suites =
with profiles; {
suites = with profiles; {
base = [cachix core users.root];
work = [users.patriot develop];
};
@ -129,7 +125,7 @@
modules = [];
importables = rec {
profiles = digga.lib.rakeLeaves ./users/profiles;
suites = with profiles; rec { base = [direnv git starship]; };
suites = with profiles; rec {base = [direnv git starship];};
};
};
devshell = ./shell;

View File

@ -1,12 +1,8 @@
{
suites,
...
}:
{
{suites, ...}: {
### root password is empty by default ###
imports = suites.base;
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.networkmanager.enable = true;
fileSystems."/" = { device = "/dev/disk/by-label/nixos"; };
fileSystems."/" = {device = "/dev/disk/by-label/nixos";};
}

View File

@ -1,8 +1,4 @@
{
profiles,
...
}:
{
{profiles, ...}: {
# build with: `bud build bootstrap bootstrapIso`
# reachable on the local link via ssh root@fe80::47%eno1
# where 'eno1' is replaced by your own machine's network
@ -16,5 +12,5 @@
];
boot.loader.systemd-boot.enable = true;
# will be overridden by the bootstrapIso instrumentation
fileSystems."/" = { device = "/dev/disk/by-label/nixos"; };
fileSystems."/" = {device = "/dev/disk/by-label/nixos";};
}

View File

@ -6,8 +6,7 @@
suites,
profiles,
...
}:
let
}: let
btrfsPartPath = "/dev/disk/by-label/NIXOS";
btrfsOptions = ["compress-force=zstd" "noatime"];
btrfsDiff =
@ -76,7 +75,7 @@ in {
btrfs subvolume snapshot /mnt/root-blank /mnt/root
umount /mnt
'';
kernel.sysctl = { "fs.inotify.max_user_watches" = 524288; };
kernel.sysctl = {"fs.inotify.max_user_watches" = 524288;};
};
security.pam.loginLimits = [
{
@ -132,8 +131,7 @@ in {
mitigations.disable = true;
allowSimultaneousMultithreading = false;
# Deleting root subvolume makes sudo show lecture every boot
sudo.extraConfig =
''
sudo.extraConfig = ''
Defaults lecture = never
'';
rtkit.enable = true;
@ -152,8 +150,7 @@ in {
driSupport32Bit = true;
enable = true;
extraPackages = with pkgs; [amdvlk libvdpau-va-gl vaapiVdpau libva vulkan-loader pipewire];
extraPackages32 =
with pkgs.pkgsi686Linux;
extraPackages32 = with pkgs.pkgsi686Linux;
[libvdpau-va-gl vaapiVdpau libva vulkan-loader pipewire] ++ [pkgs.driversi686Linux.amdvlk];
};
pulseaudio = {
@ -186,13 +183,19 @@ in {
};
networking.interfaces.enp6s0.useDHCP = true;
services = {
code-server = {
enable = false;
auth = "none";
user = "patriot";
group = "users";
};
ipfs = {
enable = false;
enableGC = true;
autoMount = true;
};
flatpak.enable = false;
xserver = { videoDrivers = ["amdgpu"]; };
xserver = {videoDrivers = ["amdgpu"];};
postgresql = {
enable = false;
enableTCPIP = true;
@ -203,7 +206,7 @@ in {
local all all trust
host all all 0.0.0.0/0 md5
'';
settings = { listen_addresses = "*"; };
settings = {listen_addresses = "*";};
initialScript =
pkgs.writeText
"backend-initScript"
@ -215,7 +218,7 @@ in {
};
};
virtualisation = {
podman.enable = false;
podman.enable = true;
libvirtd.enable = false;
};
system.stateVersion = "20.09";

View File

@ -9,7 +9,7 @@ let
sha256 = "0zd3x46fswh5n6faq4x2kkpy6p3c6j593xbdlbsl40ppkclwc80x";
}
)
{ src = ../../.; }
{src = ../../.;}
);
in
flake

View File

@ -1,5 +1,4 @@
{ ... }:
let
{...}: let
inherit (default.inputs.nixos) lib;
host = configs.${hostname} or configs.NixOS;
configs = default.nixosConfigurations;

View File

@ -1,8 +1,8 @@
{ lib }:
{lib}:
lib.makeExtensible
(
self: {
pkgBinNoDep = pkgs: name: "${pkgs.${name}}/bin/${name}";
html = import ./html.nix { format = true; };
html = import ./html.nix {format = true;};
}
)

View File

@ -1,5 +1,4 @@
{ format ? false }:
let
{format ? false}: let
inherit (builtins) isAttrs isList map;
fmt =
if format
@ -12,22 +11,21 @@ let
builtins.listToAttrs (map
(n: {
name = n;
value = (f n);
value = f n;
})
names);
evalChildren = children:
if isList children
then concatStrings children
else children;
tag =
name: maybeAttrs:
tag = name: maybeAttrs:
if isAttrs maybeAttrs
then (children: "<${name}${evalAttrs maybeAttrs}>${fmt}${evalChildren children}${fmt}</${name}>")
else tag name {} maybeAttrs;
tags = (genAttrs tag ["html" "head" "body" "div" "p" "a"]);
tags = genAttrs tag ["html" "head" "body" "div" "p" "a"];
in
tags
// {
inherit tag;
link = url: tags.a { href = url; };
link = url: tags.a {href = url;};
}

View File

@ -1,5 +1,4 @@
{ ... }:
{
{...}: {
console.keyMap = "trq";
i18n = {
defaultLocale = "en_US.UTF-8";

View File

@ -1,11 +1,7 @@
{
config,
...
}:
{
{config, ...}: {
home-manager.sharedModules = [
{
home.sessionVariables = { inherit (config.environment.sessionVariables) NIX_PATH; };
home.sessionVariables = {inherit (config.environment.sessionVariables) NIX_PATH;};
xdg.configFile."nix/registry.json".text = config.environment.etc."nix/registry.json".text;
}
];

View File

@ -2,7 +2,6 @@
channel,
inputs,
...
}:
{
}: {
nix.nixPath = ["nixpkgs=${channel.input}" "nixos-config=${../lib/compat/nixos}" "home-manager=${inputs.home}"];
}

View File

@ -6,8 +6,7 @@
with lib; let
inherit (builtins) readFile fetchurl;
cfg = config.security.mitigations;
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'';
in {
options = {
@ -16,13 +15,12 @@ in {
{
type = types.bool;
default = false;
description =
''
description = ''
Whether to disable spectre and meltdown mitigations in the kernel. Do
not use this in mission critical deployments, or on any machine you do
not have physical access to.
'';
};
};
config = mkIf cfg.disable { boot.kernelParams = splitString " " cmdline; };
config = mkIf cfg.disable {boot.kernelParams = splitString " " cmdline;};
}

View File

@ -1,6 +1,5 @@
_: prev: let
cliArgs =
let
cliArgs = let
flags = [
"--flag-switches-begin"
"--enable-features=WebUIDarkMode,UseOzonePlatform,WebRTCPipeWireCapturer,IgnoreGPUBlocklist,Vulkan"
@ -16,4 +15,4 @@ _: prev: let
];
in
prev.lib.concatStringsSep " " flags;
in { chromium = prev.chromium.override { commandLineArgs = cliArgs; }; }
in {chromium = prev.chromium.override {commandLineArgs = cliArgs;};}

View File

@ -2,7 +2,6 @@ final: prev: rec {
discord-canary-system =
prev.callPackage
mkDiscord
(
rec {
pname = "discord-canary";
version = "0.0.131";
@ -22,10 +21,8 @@ final: prev: rec {
"--enable-zero-copy"
"--disable-gpu-driver-bug-workarounds"
];
}
);
mkDiscord =
{
};
mkDiscord = {
pname,
version,
src,
@ -163,8 +160,7 @@ final: prev: rec {
]
)
++ extraOptions;
installPhase =
''
installPhase = ''
mkdir -p $out/{bin,usr/lib/${pname},share/pixmaps}
ln -s discord.png $out/share/pixmaps/${pname}.png
ln -s "${desktopItem}/share/applications" $out/share/
@ -201,8 +197,7 @@ final: prev: rec {
categories = "Network;InstantMessaging;";
mimeType = "x-scheme-handler/discord";
};
meta =
with lib; {
meta = with lib; {
description = "All-in-one cross-platform voice and text chat for gamers";
homepage = "https://discordapp.com/";
downloadPage = "https://discordapp.com/download";

View File

@ -12,8 +12,7 @@ final: prev: {
url = "https://dl-canary.discordapp.net/apps/linux/${version}/discord-canary-${version}.tar.gz";
sha256 = "0bijwfsd9s4awqkgxd9c2cxh7y5r06vix98qjp0dkv63r6jig8ch";
};
installPhase =
''
installPhase = ''
mkdir -p $out/{bin,opt/${binaryName},share/pixmaps}
mv * $out/opt/${binaryName}
chmod +x $out/opt/${binaryName}/${binaryName}

View File

@ -1 +1 @@
final: prev: { manix = prev.manix.overrideAttrs (o: rec { inherit (prev.sources.manix) pname version src; }); }
final: prev: {manix = prev.manix.overrideAttrs (o: rec {inherit (prev.sources.manix) pname version src;});}

View File

@ -12,13 +12,11 @@ final: prev: {
};
dontWrapQtApps = true;
buildInputs = [prev.libsForQt5.qt5.qtbase];
buildPhase =
''
buildPhase = ''
cd src/styleplugin
qmake && make
'';
installPhase =
''
installPhase = ''
mkdir -p $out/$qtPluginPrefix/styles
mv libphantomstyleplugin.so $out/$qtPluginPrefix/styles
'';

View File

@ -2,6 +2,6 @@ final: prev: {
# Since: https://github.com/NixOS/nixpkgs/pull/126137
nix-direnv =
if builtins.hasAttr "enableFlakes" prev.nix-direnv.override.__functionArgs
then prev.nix-direnv.override { enableFlakes = true; }
then prev.nix-direnv.override {enableFlakes = true;}
else prev.nix-direnv;
}

View File

@ -1,8 +1,7 @@
_: prev: let
pkgs = prev;
lib = pkgs.lib;
vscodeWayland =
let
vscodeWayland = let
flags = [
"--flag-switches-begin"
"--enable-features=UseOzonePlatform,IgnoreGPUBlocklist"
@ -21,8 +20,7 @@ _: prev: let
${pkgs.vscodium}/bin/codium ${lib.concatStringsSep " " flags}
'';
in {
vscodeWayland =
let
vscodeWayland = let
pname = "vscode";
desktop =
pkgs.makeDesktopItem
@ -41,8 +39,7 @@ in {
version = pkgs.vscode.version;
nativeBuildInputs = [pkgs.makeWrapper];
phases = ["installPhase"];
installPhase =
''
installPhase = ''
mkdir -p $out/bin
install -m755 ${vscodeWayland}/bin/${pname}-wayland $out/bin/${pname}
cp -r ${desktop}/share $out/share

View File

@ -2,8 +2,7 @@
{
fetchgit,
fetchurl,
}:
{
}: {
manix = {
pname = "manix";
version = "d08e7ca185445b929f097f8bfb1243a8ef3e10e4";

View File

@ -2,8 +2,7 @@
pkgs,
lib,
...
}:
let
}: let
folder = ./.;
toImport = name: value: folder + ("/" + name);
filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key && key != "default.nix";

View File

@ -5,22 +5,20 @@
pkgs,
lib,
...
}:
let
}: let
inherit (lib) fileContents mkIf;
pkgBin = lib.our.pkgBinNoDep pkgs;
coreBin = v: "${pkgs.coreutils}/bin/${v}";
nixBin = "${config.nix.package}/bin/nix";
in {
imports = [../cachix ../../locale];
imports = [../cachix ../../locale ../../secrets/secrets.nix];
boot = {
tmpOnTmpfs = true;
loader.systemd-boot.configurationLimit = 10;
};
console.font = "7x14";
environment = {
systemPackages =
with pkgs; [
systemPackages = with pkgs; [
binutils
coreutils
curl
@ -77,8 +75,7 @@ in {
''
)
];
shellAliases =
let
shellAliases = let
ifSudo = string: mkIf config.security.sudo.enable string;
in {
gtw = "${pkgBin "grit"} tree wnv";
@ -121,8 +118,7 @@ in {
ngcdo = ifSudo "sudo nix-collect-garbage --delete-old";
top = "${pkgs.bottom}/bin/btm";
myip = "${pkgs.dnsutils}/bin/dig +short myip.opendns.com @208.67.222.222 2>&1";
mn =
let
mn = let
manix_preview = "manix '{}' | sed 's/type: /> type: /g' | bat -l Markdown --color=always --plain";
in ''manix "" | rg '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | sk --preview="${manix_preview}" | xargs manix'';
# fix nixos-option
@ -142,24 +138,21 @@ in {
jtl = "journalctl";
};
};
system.activationScripts.diff =
''
system.activationScripts.diff = ''
${pkgs.nixUnstable}/bin/nix store \
--experimental-features 'nix-command' \
diff-closures /run/current-system "$systemConfig"
'';
nix =
let
nix = let
registry =
builtins.removeAttrs
(builtins.mapAttrs (_: v: { flake = v; }) (lib.filterAttrs (_: v: v ? outputs) inputs))
(builtins.mapAttrs (_: v: {flake = v;}) (lib.filterAttrs (_: v: v ? outputs) inputs))
["bud"];
in {
package = pkgs.nixUnstable;
gc.automatic = true;
optimise.automatic = true;
extraOptions =
''
extraOptions = ''
min-free = 536870912
keep-outputs = true
keep-derivations = true

View File

@ -1,8 +1,4 @@
{
pkgs,
...
}:
{
{pkgs, ...}: {
imports = [./editor];
environment.systemPackages = with pkgs; [git tokei];
documentation.dev.enable = true;

View File

@ -1,9 +1,5 @@
{
pkgs,
...
}:
{
{pkgs, ...}: {
imports = [./helix.nix];
environment.systemPackages = with pkgs; [alejandra];
environment.shellAliases = { nixf-all = "alejandra **/**.nix"; };
environment.shellAliases = {nixf-all = "alejandra **/**.nix";};
}

View File

@ -1,8 +1,4 @@
{
pkgs,
...
}:
let
{pkgs, ...}: let
pkg = pkgs.helix;
bin = "${pkg}/bin/hx";
in {
@ -11,5 +7,5 @@ in {
EDITOR = bin;
VISUAL = bin;
};
environment.shellAliases = { e = bin; };
environment.shellAliases = {e = bin;};
}

View File

@ -1,8 +1,4 @@
{
pkgs,
...
}:
let
{pkgs, ...}: let
pkg = pkgs.kakoune-unwrapped;
in {
environment.systemPackages = [pkg];
@ -10,5 +6,5 @@ in {
EDITOR = "${pkg}/bin/kak";
VISUAL = "${pkg}/bin/kak";
};
environment.shellAliases = { k = "${pkg}/bin/kak"; };
environment.shellAliases = {k = "${pkg}/bin/kak";};
}

View File

@ -1,5 +1 @@
{
pkgs,
...
}:
{ environment.systemPackages = with pkgs; [godot-bin godot-headless-bin godot-server-bin]; }
{pkgs, ...}: {environment.systemPackages = with pkgs; [godot-bin godot-headless-bin godot-server-bin];}

View File

@ -2,8 +2,7 @@
imports = [./dns];
networking.dhcpcd.enable = false;
networking.useDHCP = false;
networking.dhcpcd.extraConfig =
''
networking.dhcpcd.extraConfig = ''
noarp
nodelay
'';

View File

@ -1,5 +1,4 @@
{ ... }:
{
{...}: {
services.nextdns = {
enable = true;
arguments = ["-config" "75e43d"];

View File

@ -1,8 +1,7 @@
{
services.stubby = {
roundRobinUpstreams = false;
upstreamServers =
let
upstreamServers = let
nextDnsId = "75e43d";
in ''
- address_data: 45.90.28.0

Binary file not shown.

View File

@ -2,10 +2,8 @@
self,
inputs,
...
}:
{
modules =
with inputs; [
}: {
modules = with inputs; [
#bud.devshellModules.bud
];
exportedModules = [./devos.nix];

View File

@ -2,17 +2,16 @@
pkgs,
extraModulesPath,
...
}:
let
}: let
hooks = import ./hooks;
pkgWithCategory = category: package: { inherit package category; };
pkgWithCategory = category: package: {inherit package category;};
linter = pkgWithCategory "linter";
docs = pkgWithCategory "docs";
devos = pkgWithCategory "devos";
in {
_file = toString ./.;
imports = ["${extraModulesPath}/git/hooks.nix"];
git = { inherit hooks; };
git = {inherit hooks;};
# tempfix: remove when merged https://github.com/numtide/devshell/pull/123
devshell.startup.load_profiles =
pkgs.lib.mkForce
@ -33,8 +32,7 @@ in {
''
);
packages = with pkgs; [git-crypt];
commands =
with pkgs;
commands = with pkgs;
[
(devos nixUnstable)
#(devos agenix)

View File

@ -1,5 +1,4 @@
{ ... }:
{
{...}: {
users.users.nixos = {
uid = 1000;
password = "nixos";

View File

@ -3,8 +3,7 @@
pkgs,
lib,
...
}:
let
}: let
inherit (lib) mapAttrs' nameValuePair;
inherit (builtins) readDir fetchGit;
pkgBin = lib.our.pkgBinNoDep pkgs;
@ -20,8 +19,7 @@ in {
"dialout"
];
shell = pkgs.zsh;
hashedPassword =
"$6$spzqhAyJfhHy$iHgLBlhjGn1l8PnbjJdWTn1GPvcjMqYNKUzdCe/7IrX6sHNgETSr/Nfpdmq9FCXLhrAfwHOd/q/8SvfeIeNX4/";
hashedPassword = "$6$spzqhAyJfhHy$iHgLBlhjGn1l8PnbjJdWTn1GPvcjMqYNKUzdCe/7IrX6sHNgETSr/Nfpdmq9FCXLhrAfwHOd/q/8SvfeIeNX4/";
};
environment = {
systemPackages = [pkgs.qt5.qtwayland];
@ -88,22 +86,20 @@ in {
};
};
};
systemd.user.services.gnome-session-restart-dbus.serviceConfig = { Slice = "-.slice"; };
systemd.user.services.gnome-session-restart-dbus.serviceConfig = {Slice = "-.slice";};
systemd = {
targets = { network-online.enable = false; };
targets = {network-online.enable = false;};
services = {
systemd-networkd-wait-online.enable = false;
NetworkManager-wait-online.enable = false;
};
};
home-manager.users.patriot =
{
home-manager.users.patriot = {
config,
pkgs,
suites,
...
}:
let
}: let
personal = import ../../personal.nix;
name = personal.name;
email = personal.emails.primary;
@ -145,8 +141,7 @@ in {
white = "3a4d53";
};
};
colorSchemeDark =
let
colorSchemeDark = let
normal = {
black = "252525";
gray = "5b5b5b";
@ -218,8 +213,7 @@ in {
border = "#${acColor2}";
text = "#${acColor2}";
};
addIndSway =
x: {
addIndSway = x: {
background = x.background;
border = x.border;
childBorder = x.border;
@ -228,8 +222,7 @@ in {
# don't care
};
fonts = [fontComb];
extraEnv =
''
extraEnv = ''
export SDL_VIDEODRIVER=wayland
# needs qt5.qtwayland in systemPackages
export QT_QPA_PLATFORM=wayland
@ -271,14 +264,13 @@ in {
fonts.fontconfig.enable = true;
home = {
homeDirectory = nixosConfig.users.users.patriot.home;
packages =
with pkgs; [
packages = with pkgs; [
# Font stuff
fontPackage
noto-fonts-cjk
font-awesome
dejavu_fonts
(nerdfonts.override { fonts = ["Monoid"]; })
(nerdfonts.override {fonts = ["Monoid"];})
# Programs
cargo-outdated
cargo-release
@ -302,8 +294,7 @@ in {
lutris.overrideAttrs
(
old: {
profile =
''
profile = ''
${old.profile or ""}
unset VK_ICD_FILENAMES
export VK_ICD_FILENAMES=${nixosConfig.environment.variables.VK_ICD_FILENAMES}'';
@ -323,8 +314,7 @@ in {
steam.override
{
extraLibraries = pkgs: [pkgs.pipewire];
extraProfile =
''
extraProfile = ''
unset VK_ICD_FILENAMES
export VK_ICD_FILENAMES=${nixosConfig.environment.variables.VK_ICD_FILENAMES}'';
}
@ -339,23 +329,25 @@ in {
];
};
wayland.windowManager = {
sway =
let
sway = let
mkRofiCmd = args: "${config.programs.rofi.finalPackage}/bin/rofi ${lib.concatStringsSep " " args} | ${pkgs.sway}/bin/swaymsg --";
in {
enable = true;
extraSessionCommands = extraEnv;
wrapperFeatures.gtk = true;
extraConfig =
''
extraConfig = ''
exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
output HEADLESS-1 {
mode 1920x1080
bg ~/wallpaper.png fill
}
'';
config = {
fonts = {
names = [font];
size = fontSize + 0.0;
};
bars = [{ command = "${pkgBin "waybar"}"; }];
bars = [{command = "${pkgBin "waybar"}";}];
colors = {
background = "#${bgColor}";
focused = addIndSway focusedWorkspace;
@ -367,8 +359,7 @@ in {
menu = mkRofiCmd ["-show" "drun"];
modifier = "Mod4";
terminal = pkgBin "alacritty";
keybindings =
let
keybindings = let
mod = config.wayland.windowManager.sway.config.modifier;
cat = pkgs.coreutils + "/bin/cat";
grim = pkgBin "grim";
@ -387,13 +378,11 @@ in {
"${mod}+Shift+r" = "reload";
"${mod}+c" = mkRofiCmd ["-show" "calc"];
# Screenshot and copy it to clipboard
"Mod1+s" =
''
"Mod1+s" = ''
exec export SFILE="${shotFile}.png" && ${grim} "$SFILE" && ${cat} "$SFILE" | ${wl-copy} -t image/png
'';
# Save selected area as a picture and copy it to clipboard
"Mod1+Shift+s" =
''
"Mod1+Shift+s" = ''
exec export SFILE="${shotFile}.png" && ${grim} -g "$(${slurp})" "$SFILE" && ${cat} "$SFILE" | ${wl-copy} -t image/png
'';
# Record screen
@ -416,7 +405,7 @@ in {
accel_profile = "flat";
};
};
output = { "*" = { bg = config.home.homeDirectory + "/wallpaper.png" + " fill"; }; };
output = {"*" = {bg = config.home.homeDirectory + "/wallpaper.png" + " fill";};};
};
};
};
@ -429,7 +418,7 @@ in {
args = ["attach"];
};
font = {
normal = { family = font; };
normal = {family = font;};
size = fontSize;
};
colors = alacrittyColors;
@ -443,8 +432,7 @@ in {
escapeTime = 0;
keyMode = "vi";
shortcut = "a";
extraConfig =
''
extraConfig = ''
set -g default-terminal "alacritty"
set -ga terminal-overrides ",alacritty:Tc"
set -g status off
@ -482,8 +470,7 @@ in {
tabs_are_windows = true;
};
};
extraConfig =
let
extraConfig = let
domains = [
"discord.com"
"github.com"
@ -495,8 +482,7 @@ in {
"youtube.com"
"docker.com"
];
enableJsForDomain =
d: ''
enableJsForDomain = d: ''
config.set('content.javascript.enabled', True, 'https://*.${d}')
'';
in ''
@ -532,10 +518,8 @@ in {
enableVteIntegration = true;
enableAutosuggestions = true;
enableCompletion = true;
plugins =
let
fast-syntax-highlighting =
let
plugins = let
fast-syntax-highlighting = let
name = "fast-syntax-highlighting";
in {
inherit name;
@ -557,14 +541,12 @@ in {
dotDir = ".config/zsh";
history.path = ".local/share/zsh/history";
envExtra = extraEnv;
loginExtra =
''
loginExtra = ''
if [ "$(${pkgs.coreutils}/bin/tty)" = "/dev/tty1" ]; then
exec sway
fi
'';
initExtra =
''
initExtra = ''
export TERM=alacritty
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
@ -585,8 +567,7 @@ in {
shellAliases =
nixosConfig.environment.shellAliases
// {
harmony-ssh =
''
harmony-ssh = ''
${pkgs.mosh}/bin/mosh root@chat.harmonyapp.io
'';
};
@ -610,11 +591,9 @@ in {
};
vscode = {
enable = true;
package = pkgs.vscodium;
extensions =
let
mkExt =
n: v: p: s: {
package = pkgs.vscode;
extensions = let
mkExt = n: v: p: s: {
name = n;
version = v;
publisher = p;
@ -625,39 +604,26 @@ in {
pkgs.vscode-utils.extensionsFromVscodeMarketplace
[
# Rust
(mkExt "rust-analyzer" "0.2.760" "matklad" "sha256-M+eFqIFwiKkiwqFRwkX5h6mc/W+NBqkXcNUdTewwkCI=")
(mkExt "rust-analyzer" "0.3.968" "matklad" "sha256-wuNdmUYburGjgri8gFJl1FSryJbz1aXjJy4NQ+/Wbk4=")
(mkExt "even-better-toml" "0.14.2" "tamasfe" "sha256-lE2t+KUfClD/xjpvexTJlEr7Kufo+22DUM9Ju4Tisp0=")
(mkExt "crates" "0.5.9" "serayuzgur" "sha256-YHIbnl2R7lqwJHi8qUQImClx9MWm+5Pc12vYw7e/RlA=")
(mkExt "crates" "0.5.10" "serayuzgur" "sha256-bY/dphiEPPgTg1zMjvxx4b0Ska2XggRucnZxtbppcLU=")
# Nix
(
mkExt "nix-env-selector" "1.0.7" "arrterian" "sha256-DnaIXJ27bcpOrIp1hm7DcrlIzGSjo4RTJ9fD72ukKlc="
)
# Go
(mkExt "Go" "0.25.1" "golang" "sha256-ZDUWN9lzDnR77W7xcMFQaaFl/6Lf/x1jgaBkwZPqGGw=")
(mkExt "Go" "0.32.0" "golang" "sha256-OsKeZrG157l1HUCDvymJ3ovLxlEEJf7RBe2hXOutdyg=")
# Flutter and dart
(mkExt "flutter" "3.22.0" "Dart-Code" "sha256-woygN6hOWlP2UayqwDhJh9KcZk1GzH7mDF5IueDRxs4=")
(mkExt "dart-code" "3.22.0" "Dart-Code" "sha256-1nTewVmlrxbXdRR1EPts46u24LHdnP5BblFsMaGlNYg=")
(mkExt "flutter" "3.37.20220301" "Dart-Code" "sha256-PS24pbqKNZ/myNcTqgjosG0Pq58yMoATKDgy3k23JlE=")
(mkExt "dart-code" "3.37.20220303" "Dart-Code" "sha256-hS+V4kLe+eGIqj/1mZdgbhxWWxqSr2ZUsc2V0HI6tN8=")
# protobuf
(mkExt "vscode-proto3" "0.5.4" "zxh404" "sha256-S89qRRlfiTsJ+fJuwdNkZywe6mei48KxIEWbGWChriE=")
(mkExt "vscode-buf" "0.3.1" "bufbuild" "sha256-KjU6WlDxYPPJjh45mCq6Kczi6odYwnLaGj4RHe3fc2w=")
(mkExt "vscode-proto3" "0.5.5" "zxh404" "sha256-Em+w3FyJLXrpVAe9N7zsHRoMcpvl+psmG1new7nA8iE=")
(mkExt "vscode-buf" "0.4.0" "bufbuild" "sha256-VM6LYYak1rB4AdpVYfKpOfizGaFI/R+iUsf6UT50vdw=")
# git
(mkExt "gitlens" "11.6.0" "eamodio" "sha256-JxCNE/IL/v94xWmhebsRZo1Gw+nSSpDgZ41ZGongGVI=")
(
mkExt
"vscode-commitizen"
"0.14.1"
"KnisterPeter"
"sha256-yw8XKGL7Ul9wV+C0yL1LFJCE3+E8u/sR9s3TjkGJPZM="
)
(mkExt "gitlens" "12.0.2" "eamodio" "sha256-et2uam4hOQkxxT+r0fwZhpWGjHk45NAOriFA/43ngpo=")
# Customization
# (mkExt "dance" "0.3.2" "gregoire" "sha256-+g8EXeCkPOPvZ60JoXkGTeSXYWrXmKrcbUaEfDppdgA=")
(mkExt "material-icon-theme" "4.6.0" "PKief" "sha256-i+3lrw3mDqK2vTMDhJYTACW5JleA+lN1XAC2imgQLUo=")
(
mkExt "github-vscode-theme" "4.1.1" "GitHub" "sha256-yLySHOx6pe7w2cyi95pQlKkn/o4VMCTkrTYHu8ASn5M="
)
(mkExt "koka" "0.0.1" "maelvalais" "sha256-ty8Mql19HgUWForggeZuHQpzTbmmB/eBFHqof5ZMKr0=")
(mkExt "vscode-rhai" "0.6.3" "rhaiscript" "sha256-gEdpM/TkkiZ50bG9qDU6BH04AJLRDcHLquniRs6m0mg=")
(mkExt "copilot" "1.2.1991" "GitHub" "sha256-pGb5xfjuy+g646doZEuKhQalkOte5dH+I+1op+vZY48=")
(mkExt "material-icon-theme" "4.14.1" "PKief" "sha256-OHXi0EfeyKMeFiMU5yg0aDoWds4ED0lb+l6T12XZ3LQ=")
(mkExt "horizon-theme-vscode" "1.0.0" "alexandernanberg" "sha256-M7SmOYPkAVi5jQLynZqTjmFo9UcQ6W4dU4euP6ua9Z8=")
]
)
++ (
@ -671,7 +637,7 @@ in {
);
userSettings = {
"workbench.iconTheme" = "material-icon-theme";
"workbench.colorTheme" = "GitHub Dark";
"workbench.colorTheme" = "Horizon Bold";
"rust-analyzer.cargo.loadOutDirsFromCheck" = true;
"rust-analyzer.procMacro.enable" = true;
"rust-analyzer.server.path" = "${pkgs.rust-analyzer}/bin/rust-analyzer";
@ -685,12 +651,12 @@ in {
"nix.enableLanguageServer" = true;
"nix.serverPath" = pkgBin "rnix-lsp";
"editor.bracketPairColorization.enabled" = true;
"editor.semanticHighlighting.enabled" = true;
};
};
};
services = {
gpg-agent =
let
gpg-agent = let
defaultCacheTtl = 3600 * 6;
maxCacheTtl = 3600 * 24;
in {
@ -712,8 +678,7 @@ in {
xdg = {
enable = true;
configFile = {
"helix/themes/mytheme.toml".text =
''
"helix/themes/mytheme.toml".text = ''
"attribute" = { fg = "#${colorScheme.bright.yellow}]" }
"comment" = { fg = "#${colorScheme.normal.gray}", modifiers = ['italic'] }
"constant" = { fg = "#${colorScheme.normal.blue}" }
@ -756,22 +721,19 @@ in {
"warning" = { fg = "#${colorScheme.normal.yellow}", modifiers = ['bold'] }
"error" = { fg = "#${colorScheme.bright.red}", modifiers = ['bold'] }
'';
"helix/config.toml".text =
''
"helix/config.toml".text = ''
theme = "mytheme"
[editor]
line-number = "relative"
[lsp]
display-messages = true
'';
"helix/languages.toml".text =
''
"helix/languages.toml".text = ''
[[language]]
name = "nix"
language-server = { command = "${pkgBin "rnix-lsp"}" }
'';
"waybar/config".text =
let
"waybar/config".text = let
swayEnabled = config.wayland.windowManager.sway.enable;
in
builtins.toJSON
@ -787,9 +749,9 @@ in {
then ["sway/window"]
else [];
modules-right = ["pulseaudio" "cpu" "memory" "temperature" "clock" "tray"];
tray = { spacing = 8; };
cpu = { format = "/cpu {usage}/"; };
memory = { format = "/mem {}/"; };
tray = {spacing = 8;};
cpu = {format = "/cpu {usage}/";};
memory = {format = "/mem {}/";};
temperature = {
hwmon-path = "/sys/class/hwmon/hwmon1/temp2_input";
format = "/tmp {temperatureC}C/";
@ -803,11 +765,9 @@ in {
format-source-muted = "/mic/";
};
};
"waybar/style.css".text =
let
"waybar/style.css".text = let
makeBorder = color: "border-bottom: 3px solid #${color};";
makeInfo =
color: ''
makeInfo = color: ''
color: #${color};
${makeBorder color}
'';

View File

@ -1,7 +1,7 @@
{
programs.git = {
enable = true;
extraConfig = { pull.rebase = true; };
extraConfig = {pull.rebase = true;};
lfs.enable = true;
aliases = {
a = "add -p";
@ -31,8 +31,7 @@
rs1ft = "soft HEAD~1";
rh1rd = "hard HEAD~1";
# logging
l =
"log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit";
l = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit";
plog = "log --graph --pretty='format:%C(red)%d%C(reset) %C(yellow)%h%C(reset) %ar %C(green)%aN%C(reset) %s'";
tlog = "log --stat --since='1 Day Ago' --graph --pretty=oneline --abbrev-commit --date=relative";
rank = "shortlog -sn --no-merges";

View File

@ -3,14 +3,12 @@
config,
pkgs,
...
}:
{
}: {
home.packages = with pkgs; [hikari xwayland];
xdg = {
enable = true;
configFile = {
"hikari/hikari.conf".text =
''
"hikari/hikari.conf".text = ''
ui {
border = 1
gap = 0
@ -195,8 +193,7 @@
}
}
'';
"hikari/autostart".source =
"${
"hikari/autostart".source = "${
pkgs.writeScriptBin
"hikari-autostart"
''

View File

@ -1,5 +1,4 @@
{ ... }:
{
{...}: {
programs.starship = {
enable = true;
settings = {

View File

@ -1,5 +1 @@
{
pkgs,
...
}:
{ home.packages = [pkgs.wtf]; }
{pkgs, ...}: {home.packages = [pkgs.wtf];}

View File

@ -1,5 +1,3 @@
{ ... }:
{
users.users.root.initialHashedPassword =
"$6$XLWo1sPpgp63Zm$XHBbULH9q1gb/.yalPPU/I7EgTcW80bM.moCjIe/qGyOwE47VcXNVbTHloBZdIWQq0MfIG0IxInAu59.oJyos/";
{...}: {
users.users.root.initialHashedPassword = "$6$XLWo1sPpgp63Zm$XHBbULH9q1gb/.yalPPU/I7EgTcW80bM.moCjIe/qGyOwE47VcXNVbTHloBZdIWQq0MfIG0IxInAu59.oJyos/";
}