This commit is contained in:
dusk 2022-02-18 20:31:01 +03:00
parent 041535655b
commit c7c11e2780
Signed by: dusk
GPG Key ID: 1D8F8FAF2294D6EA
56 changed files with 1546 additions and 1475 deletions

View File

@ -1,10 +1,17 @@
{ pkgs, lib, budUtils, ... }: { {
bud.cmds = with pkgs; { pkgs,
get = { lib,
writer = budUtils.writeBashWithPaths [ nixUnstable git coreutils ]; budUtils,
synopsis = "get [DEST]"; ...
help = "Copy the desired template to DEST"; }:
script = ./get.bash; {
bud.cmds =
with pkgs; {
get = {
writer = budUtils.writeBashWithPaths [nixUnstable git coreutils];
synopsis = "get [DEST]";
help = "Copy the desired template to DEST";
script = ./get.bash;
};
}; };
};
} }

View File

@ -1,31 +1,17 @@
let let
inherit (default.inputs.nixos) lib; inherit (default.inputs.nixos) lib;
default = (import ./lib/compat).defaultNix; default = (import ./lib/compat).defaultNix;
ciSystems = ["aarch64-linux" "i686-linux" "x86_64-linux"];
ciSystems = [ filterSystems = lib.filterAttrs (system: _: lib.elem system ciSystems);
"aarch64-linux" recurseIntoAttrsRecursive =
"i686-linux" lib.mapAttrs (_: v:
"x86_64-linux" if lib.isAttrs v
]; then recurseIntoAttrsRecursive (lib.recurseIntoAttrs v)
else v);
filterSystems = lib.filterAttrs systemOutputs =
(system: _: lib.elem system ciSystems); lib.filterAttrs
(name: set: lib.isAttrs set && lib.any (system: set ? ${system} && name != "legacyPackages") ciSystems)
recurseIntoAttrsRecursive = lib.mapAttrs (_: v:
if lib.isAttrs v
then recurseIntoAttrsRecursive (lib.recurseIntoAttrs v)
else v
);
systemOutputs = lib.filterAttrs
(name: set: lib.isAttrs set
&& lib.any
(system: set ? ${system} && name != "legacyPackages")
ciSystems
)
default.outputs; default.outputs;
ciDrvs = lib.mapAttrs (_: system: filterSystems system) systemOutputs; ciDrvs = lib.mapAttrs (_: system: filterSystems system) systemOutputs;
in in
(recurseIntoAttrsRecursive ciDrvs) // { shell = import ./shell.nix; } (recurseIntoAttrsRecursive ciDrvs) // { shell = import ./shell.nix; }

View File

@ -1,5 +1,26 @@
{ {
"nodes": { "nodes": {
"alejandra": {
"inputs": {
"flakeCompat": "flakeCompat",
"nixpkgs": [
"nixos"
]
},
"locked": {
"lastModified": 1645204343,
"narHash": "sha256-h/R5uZwiCPh/i8eOcGgAD1hRFF6gHvD1GYZxkKYXTaQ=",
"owner": "kamadorueda",
"repo": "alejandra",
"rev": "4a7a938e8d29a9a3b7f45660f0f7a3f6247965bf",
"type": "github"
},
"original": {
"owner": "kamadorueda",
"repo": "alejandra",
"type": "github"
}
},
"blank": { "blank": {
"locked": { "locked": {
"lastModified": 1625557891, "lastModified": 1625557891,
@ -17,11 +38,11 @@
}, },
"cachix": { "cachix": {
"locked": { "locked": {
"lastModified": 1637798660, "lastModified": 1642244250,
"narHash": "sha256-MrPmoGeiOjlT17j3ZQx6iab07YVnomRiBFLcOCiCYnk=", "narHash": "sha256-vWpUEqQdVP4srj+/YLJRTN9vjpTs4je0cdWKXPbDItc=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "91e6a9a6568f751bb10222a937507e7e151a035e", "rev": "0fd9ee1aa36ce865ad273f4f07fdc093adeb5c00",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -34,7 +55,10 @@
"deploy": { "deploy": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat",
"nixpkgs": "nixpkgs", "nixpkgs": [
"digga",
"latest"
],
"utils": "utils" "utils": "utils"
}, },
"locked": { "locked": {
@ -71,7 +95,6 @@
"blank": "blank", "blank": "blank",
"deploy": "deploy", "deploy": "deploy",
"devshell": "devshell", "devshell": "devshell",
"flake-utils": "flake-utils",
"flake-utils-plus": "flake-utils-plus", "flake-utils-plus": "flake-utils-plus",
"home-manager": [ "home-manager": [
"home" "home"
@ -86,11 +109,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1640031018, "lastModified": 1643510242,
"narHash": "sha256-ZzyS803XuCl99XE4581m0Suni+q1Hz+Mpw6A9bs7VKM=", "narHash": "sha256-9C9DyJhQ5bevk0CEEjGct+U9EqUgHg8T70nxz47zjMI=",
"owner": "divnix", "owner": "divnix",
"repo": "digga", "repo": "digga",
"rev": "3157889810e51a1ae03f82bf6bf6657ba8cf93c6", "rev": "33bfb05b8a148d8ad6a842de74e22209bf9fe5d7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -133,34 +156,35 @@
}, },
"flake-utils-plus": { "flake-utils-plus": {
"inputs": { "inputs": {
"flake-utils": "flake-utils_2" "flake-utils": "flake-utils"
}, },
"locked": { "locked": {
"lastModified": 1638994888, "lastModified": 1639385028,
"narHash": "sha256-iz/ynGNZlvqKCOnFrEKqGA+BVKGQMG+g2JT+e3OOLN8=", "narHash": "sha256-oqorKz3mwf7UuDJwlbCEYCB2LfcWLL0DkeCWhRIL820=",
"owner": "divnix", "owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus", "repo": "flake-utils-plus",
"rev": "b4f9f517574cb7bd6ee3f19c72c19634c9f536e1", "rev": "be1be083af014720c14f3b574f57b6173b4915d0",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "divnix", "owner": "gytis-ivaskevicius",
"repo": "flake-utils-plus", "repo": "flake-utils-plus",
"type": "github" "type": "github"
} }
}, },
"flake-utils_2": { "flakeCompat": {
"flake": false,
"locked": { "locked": {
"lastModified": 1638122382, "lastModified": 1641205782,
"narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=", "narHash": "sha256-4jY7RCWUoZ9cKD8co0/4tFARpWB+57+r1bLLvXNJliY=",
"owner": "numtide", "owner": "edolstra",
"repo": "flake-utils", "repo": "flake-compat",
"rev": "74f7e4319258e287b0f9cb95426c9853b282730b", "rev": "b7547d3eed6f32d06102ead8991ec52ab0a4f1a7",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "numtide", "owner": "edolstra",
"repo": "flake-utils", "repo": "flake-compat",
"type": "github" "type": "github"
} }
}, },
@ -171,11 +195,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1640417317, "lastModified": 1645140957,
"narHash": "sha256-jT2uMARXs0Xm65ccroFsKyr4LTHSecw+9HAnmBdJO8U=", "narHash": "sha256-WTJzLSCDLBI537o2L/3kRyqEV5YRT7+1QSGryeKReHE=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "48f2b381dd397ec88040d3354ac9c036739ba139", "rev": "4f4165a8b9108818ab0193bbd1a252106870b2a2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -223,11 +247,11 @@
}, },
"nixlib": { "nixlib": {
"locked": { "locked": {
"lastModified": 1639874050, "lastModified": 1641688481,
"narHash": "sha256-S4lNc3fb9UpYgVtTa/mZZXphq7+xGy74YGIlOWB1ceE=", "narHash": "sha256-6L+EU12xLDHby7y8elgFtRKVBxix+7qV8DhVgXqrKZo=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixpkgs.lib", "repo": "nixpkgs.lib",
"rev": "2762facc37b4f6f2bf61edc43dd63caef265f85a", "rev": "f697717b3d3a074ffc16c8c8227504f0db292886",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -238,11 +262,11 @@
}, },
"nixos": { "nixos": {
"locked": { "locked": {
"lastModified": 1640319671, "lastModified": 1644525281,
"narHash": "sha256-ZkKmakwaOaLiZOpIZWbeJZwap5CzJ30s4UJTfydYIYc=", "narHash": "sha256-D3VuWLdnLmAXIkooWAtbTGSQI9Fc1lkvAr94wTxhnTU=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "eac07edbd20ed4908b98790ba299250b5527ecdf", "rev": "48d63e924a2666baf37f4f14a18f19347fbd54a2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -255,7 +279,10 @@
"nixos-generators": { "nixos-generators": {
"inputs": { "inputs": {
"nixlib": "nixlib", "nixlib": "nixlib",
"nixpkgs": "nixpkgs_2" "nixpkgs": [
"digga",
"blank"
]
}, },
"locked": { "locked": {
"lastModified": 1637655461, "lastModified": 1637655461,
@ -273,11 +300,11 @@
}, },
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1639986101, "lastModified": 1644870092,
"narHash": "sha256-Ow0+pkY7qMw6lMAvR1mEdUT9svJnrkbaRoqp4bkMTpg=", "narHash": "sha256-RLPD92lqXW98LDIbbwYqwAbt3R4iD1V1PiylfgBq5cU=",
"owner": "nixos", "owner": "nixos",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "3f92db38374b2977aea8daf4c4fe2fa0eddbd60c", "rev": "10eab1c4cd8e715c0b41d32c28af2b89fc67bed0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -288,11 +315,11 @@
}, },
"nixosPersistence": { "nixosPersistence": {
"locked": { "locked": {
"lastModified": 1638981861, "lastModified": 1644791231,
"narHash": "sha256-rDEn/hU9ayDig2HMYKN71InhY1LV5slxp9Zy2iPBysQ=", "narHash": "sha256-iDihsF1fUMK4xXiUudPnDM3veH1LXbbxfP9Lzekw9iU=",
"owner": "nix-community", "owner": "nix-community",
"repo": "impermanence", "repo": "impermanence",
"rev": "df5038f20c9efd442944fe26b93f41c0dc5217da", "rev": "635bcd2d88739197a0b584aa9fadaa53c717a853",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -301,22 +328,6 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs": {
"locked": {
"lastModified": 1640328990,
"narHash": "sha256-KQbvJx4qO9bo04tfTZuISyY4vRC5k3ZB3lyLS21XWIw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ab93217a2b74a1c36bc892c14f44ee5959c33f12",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgsWayland": { "nixpkgsWayland": {
"inputs": { "inputs": {
"cachix": "cachix", "cachix": "cachix",
@ -325,11 +336,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1637983357, "lastModified": 1643841979,
"narHash": "sha256-kferWoUKAAJO17t2D2nsEMvjMmOH1zyJPFUHtm+Cgn4=", "narHash": "sha256-/TNrk/59NpBADaHzFVraQQlHLfIgAPCgoR3F3vIw0EA=",
"owner": "colemickens", "owner": "colemickens",
"repo": "nixpkgs-wayland", "repo": "nixpkgs-wayland",
"rev": "1e481bafca9e03ead4b85e4f46d8d959c5f9b11c", "rev": "da0699ec283382fcc018072bafd573b4d7257d0e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -338,22 +349,6 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_2": {
"locked": {
"lastModified": 1640328990,
"narHash": "sha256-KQbvJx4qO9bo04tfTZuISyY4vRC5k3ZB3lyLS21XWIw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ab93217a2b74a1c36bc892c14f44ee5959c33f12",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"rnixLsp": { "rnixLsp": {
"inputs": { "inputs": {
"naersk": [ "naersk": [
@ -362,17 +357,14 @@
"nixpkgs": [ "nixpkgs": [
"nixos" "nixos"
], ],
"utils": [ "utils": "utils_2"
"digga",
"flake-utils"
]
}, },
"locked": { "locked": {
"lastModified": 1640347520, "lastModified": 1643586450,
"narHash": "sha256-UkieGBW9ap0pQbumYoG60Ed+BpzMRGuLQ6Zb41u7Fkk=", "narHash": "sha256-BRIAc3+zavSlJPYSbov2n1W9/a4Iuh2swFPYRWjCm1g=",
"owner": "nix-community", "owner": "nix-community",
"repo": "rnix-lsp", "repo": "rnix-lsp",
"rev": "d7cc2887ac9e65dd01715aac472edbf46b93ed31", "rev": "41eb2f3366e3f351bf2563c2a7c46fd17e78dfe0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -383,6 +375,7 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"alejandra": "alejandra",
"digga": "digga", "digga": "digga",
"home": "home", "home": "home",
"naersk": "naersk", "naersk": "naersk",
@ -407,6 +400,21 @@
"repo": "flake-utils", "repo": "flake-utils",
"type": "github" "type": "github"
} }
},
"utils_2": {
"locked": {
"lastModified": 1638122382,
"narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "74f7e4319258e287b0f9cb95426c9853b282730b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

187
flake.nix
View File

@ -1,91 +1,105 @@
{ {
description = "A highly structured configuration database."; description = "A highly structured configuration database.";
inputs = {
inputs = nixos.url = "github:nixos/nixpkgs/nixos-unstable";
{ digga.url = "github:divnix/digga/main";
nixos.url = "github:nixos/nixpkgs/nixos-unstable"; digga.inputs.nixpkgs.follows = "nixos";
digga.inputs.nixlib.follows = "nixos";
digga.url = "github:divnix/digga/main"; digga.inputs.home-manager.follows = "home";
digga.inputs.nixpkgs.follows = "nixos"; home.url = "github:nix-community/home-manager/master";
digga.inputs.nixlib.follows = "nixos"; home.inputs.nixpkgs.follows = "nixos";
digga.inputs.home-manager.follows = "home"; naersk.url = "github:nmattia/naersk";
naersk.inputs.nixpkgs.follows = "nixos";
home.url = "github:nix-community/home-manager/master"; nixos-hardware.url = "github:nixos/nixos-hardware";
home.inputs.nixpkgs.follows = "nixos"; rnixLsp = {
url = "github:nix-community/rnix-lsp";
naersk.url = "github:nmattia/naersk"; inputs.naersk.follows = "naersk";
naersk.inputs.nixpkgs.follows = "nixos"; inputs.nixpkgs.follows = "nixos";
nixos-hardware.url = "github:nixos/nixos-hardware";
rnixLsp = {
url = "github:nix-community/rnix-lsp";
inputs.naersk.follows = "naersk";
inputs.nixpkgs.follows = "nixos";
inputs.utils.follows = "digga/flake-utils";
};
/*helix = {
url = "https://github.com/helix-editor/helix.git";
type = "git";
submodules = true;
inputs.nixpkgs.follows = "nixos";
};*/
nixosPersistence.url = "github:nix-community/impermanence";
nixpkgsWayland = {
url = "github:colemickens/nixpkgs-wayland";
inputs.nixpkgs.follows = "nixos";
};
}; };
alejandra = {
url = "github:kamadorueda/alejandra";
inputs.nixpkgs.follows = "nixos";
};
/*
helix = {
url = "https://github.com/helix-editor/helix.git";
type = "git";
submodules = true;
inputs.nixpkgs.follows = "nixos";
};
*/
nixosPersistence.url = "github:nix-community/impermanence";
nixpkgsWayland = {
url = "github:colemickens/nixpkgs-wayland";
inputs.nixpkgs.follows = "nixos";
};
};
outputs = outputs =
{ self {
, digga self,
, nixos digga,
, home nixos,
, nixos-hardware home,
, nixosPersistence nixos-hardware,
, nixpkgsWayland nixosPersistence,
, rnixLsp nixpkgsWayland,
#, helix rnixLsp,
, ... alejandra,
} @ inputs: ...
digga.lib.mkFlake }
@ inputs:
digga.lib.mkFlake
{ {
inherit self inputs; inherit self inputs;
channelsConfig = { allowUnfree = true; }; channelsConfig = { allowUnfree = true; };
channels = { channels = {
nixos = { nixos = {
imports = [ (digga.lib.importOverlays ./overlays) ]; imports = [(digga.lib.importOverlays ./overlays)];
overlays = [ overlays = [
#nixpkgsWayland.overlay #nixpkgsWayland.overlay
(_: prev: { (
#helix = helix.packages.${prev.system}.helix; _: prev: {
#helix-src = prev.helix.src; #helix = helix.packages.${prev.system}.helix;
#rnix-lsp = rnixLsp.packages.${prev.system}.rnix-lsp; #helix-src = prev.helix.src;
}) #rnix-lsp = rnixLsp.packages.${prev.system}.rnix-lsp;
}
)
(
_: prev: {
alejandra = alejandra.defaultPackage.${prev.system};
remarshal =
prev.remarshal.overrideAttrs
(
old: {
postPatch =
''
substituteInPlace pyproject.toml \
--replace "poetry.masonry.api" "poetry.core.masonry.api" \
--replace 'PyYAML = "^5.3"' 'PyYAML = "*"' \
--replace 'tomlkit = "^0.7"' 'tomlkit = "*"'
'';
}
);
}
)
./pkgs/default.nix ./pkgs/default.nix
]; ];
}; };
}; };
lib = import ./lib { lib = digga.lib // nixos.lib; }; lib = import ./lib { lib = digga.lib // nixos.lib; };
sharedOverlays = [ sharedOverlays = [
(_: prev: { (
__dontExport = true; _: prev: {
lib = prev.lib.extend (_: _: { __dontExport = true;
our = self.lib; lib = prev.lib.extend (_: _: { our = self.lib; });
}); }
}) )
]; ];
nixos = { nixos = {
hostDefaults = { hostDefaults = {
system = "x86_64-linux"; system = "x86_64-linux";
channelName = "nixos"; channelName = "nixos";
imports = [ (digga.lib.importExportableModules ./modules) ]; imports = [(digga.lib.importExportableModules ./modules)];
modules = [ modules = [
{ lib.our = self.lib; } { lib.our = self.lib; }
digga.nixosModules.bootstrapIso digga.nixosModules.bootstrapIso
@ -94,37 +108,32 @@
nixosPersistence.nixosModules.impermanence nixosPersistence.nixosModules.impermanence
]; ];
}; };
imports = [(digga.lib.importHosts ./hosts)];
imports = [ (digga.lib.importHosts ./hosts) ]; hosts = {};
hosts = { };
importables = rec { importables = rec {
profiles = (digga.lib.rakeLeaves ./profiles) // { profiles =
users = digga.lib.rakeLeaves ./users; (digga.lib.rakeLeaves ./profiles)
nixos-hardware = nixos-hardware.nixosModules; // {
}; users = digga.lib.rakeLeaves ./users;
suites = with profiles; { nixos-hardware = nixos-hardware.nixosModules;
base = [ cachix core users.root ]; };
work = [ users.patriot develop ]; suites =
}; with profiles; {
base = [cachix core users.root];
work = [users.patriot develop];
};
}; };
}; };
home = { home = {
imports = [ (digga.lib.importExportableModules ./users/modules) ]; imports = [(digga.lib.importExportableModules ./users/modules)];
modules = [ ]; modules = [];
importables = rec { importables = rec {
profiles = digga.lib.rakeLeaves ./users/profiles; profiles = digga.lib.rakeLeaves ./users/profiles;
suites = with profiles; rec { suites = with profiles; rec { base = [direnv git starship]; };
base = [ direnv git starship ];
};
}; };
}; };
devshell = ./shell; devshell = ./shell;
homeConfigurations = digga.lib.mkHomeConfigurations self.nixosConfigurations; homeConfigurations = digga.lib.mkHomeConfigurations self.nixosConfigurations;
deploy.nodes = digga.lib.mkDeployNodes self.nixosConfigurations {};
deploy.nodes = digga.lib.mkDeployNodes self.nixosConfigurations { }; };
}
;
} }

View File

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

View File

@ -1,4 +1,7 @@
{ profiles, ... }: {
profiles,
...
}:
{ {
# build with: `bud build bootstrap bootstrapIso` # build with: `bud build bootstrap bootstrapIso`
# reachable on the local link via ssh root@fe80::47%eno1 # reachable on the local link via ssh root@fe80::47%eno1
@ -7,12 +10,11 @@
imports = [ imports = [
# profiles.networking # profiles.networking
profiles.core profiles.core
profiles.users.root # make sure to configure ssh keys profiles.users.root
# make sure to configure ssh keys
profiles.users.nixos profiles.users.nixos
]; ];
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
# will be overridden by the bootstrapIso instrumentation # will be overridden by the bootstrapIso instrumentation
fileSystems."/" = { device = "/dev/disk/by-label/nixos"; }; fileSystems."/" = { device = "/dev/disk/by-label/nixos"; };
} }

View File

@ -1,76 +1,83 @@
{ config, lib, pkgs, modulesPath, suites, profiles, ... }: {
config,
lib,
pkgs,
modulesPath,
suites,
profiles,
...
}:
let let
btrfsPartPath = "/dev/disk/by-label/NIXOS"; btrfsPartPath = "/dev/disk/by-label/NIXOS";
btrfsOptions = [ "compress-force=zstd" "noatime" ]; btrfsOptions = ["compress-force=zstd" "noatime"];
btrfsDiff =
pkgs.writeScriptBin
"btrfs-diff"
''
#!${pkgs.bash}/bin/bash
set -euo pipefail
btrfsDiff = pkgs.writeScriptBin "btrfs-diff" '' sudo mkdir -p /mnt
#!${pkgs.bash}/bin/bash sudo mount -o subvol=/ ${btrfsPartPath} /mnt
set -euo pipefail
sudo mkdir -p /mnt OLD_TRANSID=$(sudo btrfs subvolume find-new /mnt/root-blank 9999999)
sudo mount -o subvol=/ ${btrfsPartPath} /mnt
OLD_TRANSID=$(sudo btrfs subvolume find-new /mnt/root-blank 9999999) sudo btrfs subvolume find-new "/mnt/root" "$OLD_TRANSID" |
sed '$d' |
sudo btrfs subvolume find-new "/mnt/root" "$OLD_TRANSID" | cut -f17- -d' ' |
sed '$d' | sort |
cut -f17- -d' ' | uniq |
sort | while read path; do
uniq | path="/$path"
while read path; do if [ -L "$path" ]; then
path="/$path" : # The path is a symbolic link, so is probably handled by NixOS already
if [ -L "$path" ]; then elif [ -d "$path" ]; then
: # The path is a symbolic link, so is probably handled by NixOS already : # The path is a directory, ignore
elif [ -d "$path" ]; then else
: # The path is a directory, ignore echo "$path"
else fi
echo "$path" done
fi
done
sudo umount /mnt
'';
in
{
imports = suites.base ++ suites.work ++ [
../profiles/network/networkmanager
(modulesPath + "/installer/scan/not-detected.nix")
] ++ (with profiles.nixos-hardware; [ common-pc-ssd common-pc common-gpu-amd common-cpu-amd ]);
sudo umount /mnt
'';
in {
imports =
suites.base
++ suites.work
++ [../profiles/network/networkmanager (modulesPath + "/installer/scan/not-detected.nix")]
++ (with profiles.nixos-hardware; [common-pc-ssd common-pc common-gpu-amd common-cpu-amd]);
boot = { boot = {
loader = { loader = {
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;
systemd-boot.enable = true; systemd-boot.enable = true;
}; };
kernelPackages = pkgs.linuxPackages_latest; kernelPackages = pkgs.linuxPackages_latest;
supportedFilesystems = [ "btrfs" ]; supportedFilesystems = ["btrfs"];
initrd = { initrd = {
availableKernelModules = availableKernelModules = ["xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"];
[ "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; kernelModules = ["amdgpu"];
kernelModules = [ "amdgpu" ];
};
kernelModules = [ "kvm-amd" ];
extraModulePackages = [ ];
initrd.postDeviceCommands = pkgs.lib.mkBefore ''
mkdir -p /mnt
mount -o subvol=/ ${btrfsPartPath} /mnt
btrfs subvolume list -o /mnt/root |
cut -f9 -d' ' |
while read subvolume; do
echo "deleting /$subvolume subvolume..."
btrfs subvolume delete "/mnt/$subvolume"
done &&
echo "deleting /root subvolume..." &&
btrfs subvolume delete /mnt/root
echo "restoring blank /root subvolume"
btrfs subvolume snapshot /mnt/root-blank /mnt/root
umount /mnt
'';
kernel.sysctl = {
"fs.inotify.max_user_watches" = 524288;
}; };
kernelModules = ["kvm-amd"];
extraModulePackages = [];
initrd.postDeviceCommands =
pkgs.lib.mkBefore
''
mkdir -p /mnt
mount -o subvol=/ ${btrfsPartPath} /mnt
btrfs subvolume list -o /mnt/root |
cut -f9 -d' ' |
while read subvolume; do
echo "deleting /$subvolume subvolume..."
btrfs subvolume delete "/mnt/$subvolume"
done &&
echo "deleting /root subvolume..." &&
btrfs subvolume delete /mnt/root
echo "restoring blank /root subvolume"
btrfs subvolume snapshot /mnt/root-blank /mnt/root
umount /mnt
'';
kernel.sysctl = { "fs.inotify.max_user_watches" = 524288; };
}; };
security.pam.loginLimits = [ security.pam.loginLimits = [
{ {
domain = "*"; domain = "*";
@ -85,61 +92,52 @@ in
value = "524288"; value = "524288";
} }
]; ];
fileSystems."/" = { fileSystems."/" = {
device = btrfsPartPath; device = btrfsPartPath;
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=root" ] ++ btrfsOptions; options = ["subvol=root"] ++ btrfsOptions;
}; };
fileSystems."/home" = { fileSystems."/home" = {
device = btrfsPartPath; device = btrfsPartPath;
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=home" ] ++ btrfsOptions; options = ["subvol=home"] ++ btrfsOptions;
}; };
#fileSystems."/media/archive" = {
fileSystems."/media/archive" = { # device = "/dev/disk/by-uuid/f9b5f7f3-51e8-4357-8518-986b16311c71";
device = "/dev/disk/by-uuid/f9b5f7f3-51e8-4357-8518-986b16311c71"; # fsType = "btrfs";
fsType = "btrfs"; # options = btrfsOptions;
options = btrfsOptions; #};
};
fileSystems."/nix" = { fileSystems."/nix" = {
device = btrfsPartPath; device = btrfsPartPath;
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=nix" ] ++ btrfsOptions; options = ["subvol=nix"] ++ btrfsOptions;
}; };
fileSystems."/persist" = { fileSystems."/persist" = {
device = btrfsPartPath; device = btrfsPartPath;
fsType = "btrfs"; fsType = "btrfs";
options = [ "subvol=persist" ] ++ btrfsOptions; options = ["subvol=persist"] ++ btrfsOptions;
neededForBoot = true; neededForBoot = true;
}; };
fileSystems."/boot" = { fileSystems."/boot" = {
device = "/dev/disk/by-uuid/5784-BBB1"; device = "/dev/disk/by-uuid/5784-BBB1";
fsType = "vfat"; fsType = "vfat";
}; };
swapDevices = [];
swapDevices = [ ];
zramSwap = { zramSwap = {
enable = true; enable = true;
algorithm = "zstd"; algorithm = "zstd";
}; };
nix.settings.max-jobs = lib.mkDefault 4;
nix.maxJobs = lib.mkDefault 4;
security = { security = {
mitigations.disable = true; mitigations.disable = true;
allowSimultaneousMultithreading = false; allowSimultaneousMultithreading = false;
# Deleting root subvolume makes sudo show lecture every boot # Deleting root subvolume makes sudo show lecture every boot
sudo.extraConfig = '' sudo.extraConfig =
Defaults lecture = never ''
''; Defaults lecture = never
'';
rtkit.enable = true; rtkit.enable = true;
}; };
sound.enable = false; sound.enable = false;
services.pipewire = { services.pipewire = {
enable = true; enable = true;
@ -153,52 +151,40 @@ in
driSupport = true; driSupport = true;
driSupport32Bit = true; driSupport32Bit = true;
enable = true; enable = true;
extraPackages = with pkgs; [ extraPackages = with pkgs; [amdvlk libvdpau-va-gl vaapiVdpau libva vulkan-loader pipewire];
amdvlk extraPackages32 =
libvdpau-va-gl with pkgs.pkgsi686Linux;
vaapiVdpau [libvdpau-va-gl vaapiVdpau libva vulkan-loader pipewire] ++ [pkgs.driversi686Linux.amdvlk];
libva
vulkan-loader
pipewire
];
extraPackages32 = with pkgs.pkgsi686Linux;
[
libvdpau-va-gl
vaapiVdpau
libva
vulkan-loader
pipewire
]
++ [ pkgs.driversi686Linux.amdvlk ];
}; };
pulseaudio = { pulseaudio = {
enable = false; enable = false;
support32Bit = true; support32Bit = true;
}; };
}; };
fonts = { fonts = {
enableDefaultFonts = true; enableDefaultFonts = true;
fontconfig.enable = true; fontconfig.enable = true;
fonts = [ pkgs.dejavu_fonts ]; fonts = [pkgs.dejavu_fonts];
}; };
environment = { environment = {
systemPackages = [ btrfsDiff ]; systemPackages = [btrfsDiff];
pathsToLink = [ "/share/zsh" ]; pathsToLink = ["/share/zsh"];
persistence."/persist" = { persistence."/persist" = {
directories = [ "/etc/nixos" ]; directories = ["/etc/nixos"];
files = [ "/etc/machine-id" ]; files = ["/etc/machine-id"];
}; };
variables = { variables = {
VK_ICD_FILENAMES = lib.mkForce "${pkgs.amdvlk}/share/vulkan/icd.d/amd_icd64.json:${pkgs.driversi686Linux.amdvlk}/share/vulkan/icd.d/amd_icd32.json"; VK_ICD_FILENAMES =
lib.mkForce
"${pkgs.amdvlk}/share/vulkan/icd.d/amd_icd64.json:${pkgs.driversi686Linux.amdvlk}/share/vulkan/icd.d/amd_icd32.json";
}; };
sessionVariables = { sessionVariables = {
VK_ICD_FILENAMES = lib.mkForce "${pkgs.amdvlk}/share/vulkan/icd.d/amd_icd64.json:${pkgs.driversi686Linux.amdvlk}/share/vulkan/icd.d/amd_icd32.json"; VK_ICD_FILENAMES =
lib.mkForce
"${pkgs.amdvlk}/share/vulkan/icd.d/amd_icd64.json:${pkgs.driversi686Linux.amdvlk}/share/vulkan/icd.d/amd_icd32.json";
}; };
}; };
networking.interfaces.enp6s0.useDHCP = true; networking.interfaces.enp6s0.useDHCP = true;
services = { services = {
ipfs = { ipfs = {
enable = false; enable = false;
@ -206,30 +192,31 @@ in
autoMount = true; autoMount = true;
}; };
flatpak.enable = false; flatpak.enable = false;
xserver = { xserver = { videoDrivers = ["amdgpu"]; };
videoDrivers = [ "amdgpu" ];
};
postgresql = { postgresql = {
enable = false; enable = false;
enableTCPIP = true; enableTCPIP = true;
authentication = lib.mkOverride 10 '' authentication =
local all all trust lib.mkOverride
host all all 0.0.0.0/0 md5 10
''; ''
settings = { local all all trust
listen_addresses = "*"; host all all 0.0.0.0/0 md5
}; '';
initialScript = pkgs.writeText "backend-initScript" '' settings = { listen_addresses = "*"; };
CREATE ROLE patriot WITH LOGIN PASSWORD 'patriot' CREATEDB; initialScript =
CREATE DATABASE harmony; pkgs.writeText
GRANT ALL PRIVILEGES ON DATABASE harmony TO patriot; "backend-initScript"
''; ''
CREATE ROLE patriot WITH LOGIN PASSWORD 'patriot' CREATEDB;
CREATE DATABASE harmony;
GRANT ALL PRIVILEGES ON DATABASE harmony TO patriot;
'';
}; };
}; };
virtualisation = { virtualisation = {
podman.enable = true; podman.enable = false;
libvirtd.enable = false; libvirtd.enable = false;
}; };
system.stateVersion = "20.09"; system.stateVersion = "20.09";
} }

View File

@ -1,14 +1,15 @@
let let
rev = "e7e5d481a0e15dcd459396e55327749989e04ce0"; rev = "e7e5d481a0e15dcd459396e55327749989e04ce0";
flake = (import flake = (
import
( (
fetchTarball { fetchTarball
{
url = "https://github.com/edolstra/flake-compat/archive/${rev}.tar.gz"; url = "https://github.com/edolstra/flake-compat/archive/${rev}.tar.gz";
sha256 = "0zd3x46fswh5n6faq4x2kkpy6p3c6j593xbdlbsl40ppkclwc80x"; sha256 = "0zd3x46fswh5n6faq4x2kkpy6p3c6j593xbdlbsl40ppkclwc80x";
} }
) )
{ { src = ../../.; }
src = ../../.; );
});
in in
flake flake

View File

@ -1,10 +1,9 @@
{ ... }: { ... }:
let let
inherit (default.inputs.nixos) lib; inherit (default.inputs.nixos) lib;
host = configs.${hostname} or configs.NixOS; host = configs.${hostname} or configs.NixOS;
configs = default.nixosConfigurations; configs = default.nixosConfigurations;
default = (import ../.).defaultNix; default = (import ../.).defaultNix;
hostname = lib.fileContents /etc/hostname; hostname = lib.fileContents /etc/hostname;
in in
host host

View File

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

View File

@ -1,22 +1,33 @@
{ format ? false }: { format ? false }:
let let
inherit (builtins) isAttrs isList map; inherit (builtins) isAttrs isList map;
fmt =
fmt = if format then "\n " else ""; if format
then "\n "
else "";
mapAttrsToList = f: attrs: map (name: f name attrs.${name}) (builtins.attrNames attrs); mapAttrsToList = f: attrs: map (name: f name attrs.${name}) (builtins.attrNames attrs);
concatStrings = builtins.concatStringsSep ""; concatStrings = builtins.concatStringsSep "";
genAttrs = f: names: builtins.listToAttrs (map (n: { name = n; value = (f n); }) names);
evalAttrs = attrs: concatStrings (mapAttrsToList (name: value: " ${name}=\"${value}\"") attrs); evalAttrs = attrs: concatStrings (mapAttrsToList (name: value: " ${name}=\"${value}\"") attrs);
evalChildren = children: if isList children then concatStrings children else children; genAttrs = f: names:
tag = name: maybeAttrs: builtins.listToAttrs (map
if isAttrs maybeAttrs (n: {
then (children: "<${name}${evalAttrs maybeAttrs}>${fmt}${evalChildren children}${fmt}</${name}>") name = n;
else tag name { } maybeAttrs; value = (f n);
})
tags = (genAttrs tag [ "html" "head" "body" "div" "p" "a" ]); names);
evalChildren = children:
if isList children
then concatStrings children
else children;
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"]);
in in
tags // { tags
inherit tag; // {
link = url: tags.a { href = url; }; inherit tag;
} link = url: tags.a { href = url; };
}

View File

@ -1,8 +1,9 @@
{ ... }: { { ... }:
{
console.keyMap = "trq"; console.keyMap = "trq";
i18n = { i18n = {
defaultLocale = "en_US.UTF-8"; defaultLocale = "en_US.UTF-8";
supportedLocales = [ "en_US.UTF-8/UTF-8" ]; supportedLocales = ["en_US.UTF-8/UTF-8"];
}; };
time.timeZone = "Turkey"; time.timeZone = "Turkey";
services.xserver.layout = "tr"; services.xserver.layout = "tr";

View File

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

View File

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

View File

@ -1,27 +1,28 @@
{ config, lib, ... }:
with lib;
let
inherit (builtins) readFile fetchurl;
cfg = config.security.mitigations;
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
{ {
config,
lib,
...
}:
with lib; let
inherit (builtins) readFile fetchurl;
cfg = config.security.mitigations;
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 = { options = {
security.mitigations.disable = mkOption { security.mitigations.disable =
type = types.bool; mkOption
default = false; {
description = '' type = types.bool;
Whether to disable spectre and meltdown mitigations in the kernel. Do default = false;
not use this in mission critical deployments, or on any machine you do description =
not have physical access to. ''
''; 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,5 +1,4 @@
_: prev: _: prev: let
let
cliArgs = cliArgs =
let let
flags = [ flags = [
@ -16,10 +15,5 @@ let
"--process-per-site" "--process-per-site"
]; ];
in in
prev.lib.concatStringsSep " " flags; prev.lib.concatStringsSep " " flags;
in in { chromium = prev.chromium.override { commandLineArgs = cliArgs; }; }
{
chromium = prev.chromium.override {
commandLineArgs = cliArgs;
};
}

View File

@ -1,196 +1,212 @@
final: prev: rec { final: prev: rec {
discord-canary-system = prev.callPackage mkDiscord (rec { discord-canary-system =
pname = "discord-canary"; prev.callPackage
version = "0.0.131"; mkDiscord
binaryName = "DiscordCanary"; (
desktopName = "Discord Canary"; rec {
src = prev.fetchurl { pname = "discord-canary";
url = "https://dl-canary.discordapp.net/apps/linux/${version}/discord-canary-${version}.tar.gz"; version = "0.0.131";
sha256 = "sha256-ZYPdE02Jq79LmvXu7KIJFugJX++Nnj0Og/mBuaP/+SA="; binaryName = "DiscordCanary";
}; desktopName = "Discord Canary";
isWayland = true; src =
enableVulkan = false; prev.fetchurl
extraOptions = [ {
"--ignore-gpu-blocklist" url = "https://dl-canary.discordapp.net/apps/linux/${version}/discord-canary-${version}.tar.gz";
"--enable-gpu-rasterization" sha256 = "sha256-ZYPdE02Jq79LmvXu7KIJFugJX++Nnj0Og/mBuaP/+SA=";
"--enable-zero-copy" };
"--disable-gpu-driver-bug-workarounds" isWayland = true;
]; enableVulkan = false;
}); extraOptions = [
"--ignore-gpu-blocklist"
"--enable-gpu-rasterization"
"--enable-zero-copy"
"--disable-gpu-driver-bug-workarounds"
];
}
);
mkDiscord = mkDiscord =
{ pname {
, version pname,
, src version,
, binaryName src,
, desktopName binaryName,
, isWayland ? false desktopName,
, enableVulkan ? false isWayland ? false,
, extraOptions ? [ ] enableVulkan ? false,
, autoPatchelfHook extraOptions ? [],
, makeDesktopItem autoPatchelfHook,
, lib makeDesktopItem,
, stdenv lib,
, wrapGAppsHook stdenv,
, alsaLib wrapGAppsHook,
, at-spi2-atk alsaLib,
, at-spi2-core at-spi2-atk,
, atk at-spi2-core,
, cairo atk,
, cups cairo,
, dbus cups,
, electron dbus,
, expat electron,
, fontconfig expat,
, freetype fontconfig,
, gdk-pixbuf freetype,
, glib gdk-pixbuf,
, gtk3 glib,
, libcxx gtk3,
, libdrm libcxx,
, libnotify libdrm,
, libpulseaudio libnotify,
, libuuid libpulseaudio,
, libX11 libuuid,
, libXScrnSaver libX11,
, libXcomposite libXScrnSaver,
, libXcursor libXcomposite,
, libXdamage libXcursor,
, libXext libXdamage,
, libXfixes libXext,
, libXi libXfixes,
, libXrandr libXi,
, libXrender libXrandr,
, libXtst libXrender,
, libxcb libXtst,
, mesa libxcb,
, nspr mesa,
, nss nspr,
, pango nss,
, systemd pango,
, libappindicator-gtk3 systemd,
, libdbusmenu libappindicator-gtk3,
, nodePackages libdbusmenu,
, vulkan-loader nodePackages,
, vulkan-extension-layer vulkan-loader,
, libGL vulkan-extension-layer,
, pipewire libGL,
pipewire,
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation
inherit pname version src; rec {
inherit pname version src;
nativeBuildInputs = [
nodePackages.asar
alsaLib
autoPatchelfHook
cups
libdrm
libuuid
libXdamage
libX11
libXScrnSaver
libXtst
libxcb
mesa.drivers
nss
wrapGAppsHook
];
dontWrapGApps = true;
libPath =
lib.makeLibraryPath
[
libcxx
systemd
libpulseaudio
stdenv.cc.cc
alsaLib
atk
at-spi2-atk
at-spi2-core
cairo
cups
dbus
expat
fontconfig
freetype
gdk-pixbuf
glib
gtk3
libnotify
libX11
libXcomposite
libuuid
libXcursor
libXdamage
libXext
libXfixes
libXi
libXrandr
libXrender
libXtst
nspr
nss
libxcb
pango
systemd
libXScrnSaver
libappindicator-gtk3
libdbusmenu
vulkan-loader
vulkan-extension-layer
libGL
pipewire
];
flags =
(
lib.optionals
isWayland
[
"--flag-switches-begin"
"--enable-features=UseOzonePlatform,WebRTCPipeWireCapturer${
lib.optionalString enableVulkan ",Vulkan"
}"
"--flag-switches-end"
"--ozone-platform=wayland"
"--enable-webrtc-pipewire-capturer"
]
)
++ extraOptions;
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/
nativeBuildInputs = [ # HACKS FOR SYSTEM ELECTRON
nodePackages.asar asar e resources/app.asar resources/app
alsaLib rm resources/app.asar
autoPatchelfHook sed -i "s|process.resourcesPath|'$out/usr/lib/${pname}'|" resources/app/app_bootstrap/buildInfo.js
cups sed -i "s|exeDir,|'$out/share/pixmaps',|" resources/app/app_bootstrap/autoStart/linux.js
libdrm asar p resources/app resources/app.asar --unpack-dir '**'
libuuid rm -rf resources/app
libXdamage
libX11
libXScrnSaver
libXtst
libxcb
mesa.drivers
nss
wrapGAppsHook
];
dontWrapGApps = true; # Copy Relevanat data
cp -r resources/* $out/usr/lib/${pname}/
libPath = lib.makeLibraryPath [ # Create starter script for discord
libcxx echo "#!${stdenv.shell}" > $out/bin/${pname}
systemd echo "exec ${electron}/bin/electron ${lib.concatStringsSep " " flags} $out/usr/lib/${pname}/app.asar \$@" >> $out/bin/${pname}
libpulseaudio chmod 755 $out/bin/${pname}
stdenv.cc.cc
alsaLib
atk
at-spi2-atk
at-spi2-core
cairo
cups
dbus
expat
fontconfig
freetype
gdk-pixbuf
glib
gtk3
libnotify
libX11
libXcomposite
libuuid
libXcursor
libXdamage
libXext
libXfixes
libXi
libXrandr
libXrender
libXtst
nspr
nss
libxcb
pango
systemd
libXScrnSaver
libappindicator-gtk3
libdbusmenu
vulkan-loader
vulkan-extension-layer
libGL
pipewire
];
flags = (lib.optionals isWayland [ wrapProgram $out/bin/${pname} \
"--flag-switches-begin" "''${gappsWrapperArgs[@]}" \
"--enable-features=UseOzonePlatform,WebRTCPipeWireCapturer${lib.optionalString enableVulkan ",Vulkan"}" --prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \
"--flag-switches-end" --prefix LD_LIBRARY_PATH : ${libPath}
"--ozone-platform=wayland" '';
"--enable-webrtc-pipewire-capturer" desktopItem =
]) ++ extraOptions; makeDesktopItem
{
installPhase = '' name = pname;
mkdir -p $out/{bin,usr/lib/${pname},share/pixmaps} exec = pname;
ln -s discord.png $out/share/pixmaps/${pname}.png icon = pname;
ln -s "${desktopItem}/share/applications" $out/share/ inherit desktopName;
genericName = meta.description;
# HACKS FOR SYSTEM ELECTRON categories = "Network;InstantMessaging;";
asar e resources/app.asar resources/app mimeType = "x-scheme-handler/discord";
rm resources/app.asar };
sed -i "s|process.resourcesPath|'$out/usr/lib/${pname}'|" resources/app/app_bootstrap/buildInfo.js meta =
sed -i "s|exeDir,|'$out/share/pixmaps',|" resources/app/app_bootstrap/autoStart/linux.js with lib; {
asar p resources/app resources/app.asar --unpack-dir '**' description = "All-in-one cross-platform voice and text chat for gamers";
rm -rf resources/app homepage = "https://discordapp.com/";
downloadPage = "https://discordapp.com/download";
# Copy Relevanat data platforms = ["x86_64-linux"];
cp -r resources/* $out/usr/lib/${pname}/ };
# Create starter script for discord
echo "#!${stdenv.shell}" > $out/bin/${pname}
echo "exec ${electron}/bin/electron ${lib.concatStringsSep " " flags} $out/usr/lib/${pname}/app.asar \$@" >> $out/bin/${pname}
chmod 755 $out/bin/${pname}
wrapProgram $out/bin/${pname} \
"''${gappsWrapperArgs[@]}" \
--prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \
--prefix LD_LIBRARY_PATH : ${libPath}
'';
desktopItem = makeDesktopItem {
name = pname;
exec = pname;
icon = pname;
inherit desktopName;
genericName = meta.description;
categories = "Network;InstantMessaging;";
mimeType = "x-scheme-handler/discord";
}; };
meta = with lib; {
description = "All-in-one cross-platform voice and text chat for gamers";
homepage = "https://discordapp.com/";
downloadPage = "https://discordapp.com/download";
platforms = [ "x86_64-linux" ];
};
};
} }

View File

@ -1,25 +1,32 @@
final: prev: { final: prev: {
discord-canary = prev.discord-canary.overrideAttrs (old: discord-canary =
let binaryName = "DiscordCanary"; in prev.discord-canary.overrideAttrs
rec { (
version = "0.0.123"; old: let
src = prev.fetchurl { binaryName = "DiscordCanary";
url = "https://dl-canary.discordapp.net/apps/linux/${version}/discord-canary-${version}.tar.gz"; in rec {
sha256 = "0bijwfsd9s4awqkgxd9c2cxh7y5r06vix98qjp0dkv63r6jig8ch"; version = "0.0.123";
}; src =
installPhase = '' prev.fetchurl
mkdir -p $out/{bin,opt/${binaryName},share/pixmaps} {
mv * $out/opt/${binaryName} url = "https://dl-canary.discordapp.net/apps/linux/${version}/discord-canary-${version}.tar.gz";
chmod +x $out/opt/${binaryName}/${binaryName} sha256 = "0bijwfsd9s4awqkgxd9c2cxh7y5r06vix98qjp0dkv63r6jig8ch";
patchelf --set-interpreter ${prev.stdenv.cc.bintools.dynamicLinker} \ };
$out/opt/${binaryName}/${binaryName} installPhase =
wrapProgram $out/opt/${binaryName}/${binaryName} \ ''
"''${gappsWrapperArgs[@]}" \ mkdir -p $out/{bin,opt/${binaryName},share/pixmaps}
--prefix XDG_DATA_DIRS : "${prev.gtk3}/share/gsettings-schemas/${prev.gtk3.name}/" \ mv * $out/opt/${binaryName}
--prefix LD_LIBRARY_PATH : "${old.libPath}:${prev.electron_9}/lib/electron:${prev.libdrm}/lib:${prev.libGL_driver.out}/lib" chmod +x $out/opt/${binaryName}/${binaryName}
ln -s $out/opt/${binaryName}/${binaryName} $out/bin/ patchelf --set-interpreter ${prev.stdenv.cc.bintools.dynamicLinker} \
ln -s $out/opt/${binaryName}/discord.png $out/share/pixmaps/${old.pname}.png $out/opt/${binaryName}/${binaryName}
ln -s "${old.desktopItem}/share/applications" $out/share/ wrapProgram $out/opt/${binaryName}/${binaryName} \
''; "''${gappsWrapperArgs[@]}" \
}); --prefix XDG_DATA_DIRS : "${prev.gtk3}/share/gsettings-schemas/${prev.gtk3.name}/" \
--prefix LD_LIBRARY_PATH : "${old.libPath}:${prev.electron_9}/lib/electron:${prev.libdrm}/lib:${prev.libGL_driver.out}/lib"
ln -s $out/opt/${binaryName}/${binaryName} $out/bin/
ln -s $out/opt/${binaryName}/discord.png $out/share/pixmaps/${old.pname}.png
ln -s "${old.desktopItem}/share/applications" $out/share/
'';
}
);
} }

View File

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

View File

@ -1,3 +1,4 @@
channels: final: prev: { channels: final: prev: {
__dontExport = true; # overrides clutter up actual creations __dontExport = true;
# overrides clutter up actual creations
} }

View File

@ -1,25 +1,26 @@
final: prev: { final: prev: {
phantomstyle = prev.stdenv.mkDerivation { phantomstyle =
pname = "phantomstyle"; prev.stdenv.mkDerivation
version = "6e9580b"; {
pname = "phantomstyle";
src = builtins.fetchGit { version = "6e9580b";
url = "https://github.com/randrew/phantomstyle.git"; src =
rev = "6e9580b72e372b5acecd616434eaf441bf73bcf4"; builtins.fetchGit
{
url = "https://github.com/randrew/phantomstyle.git";
rev = "6e9580b72e372b5acecd616434eaf441bf73bcf4";
};
dontWrapQtApps = true;
buildInputs = [prev.libsForQt5.qt5.qtbase];
buildPhase =
''
cd src/styleplugin
qmake && make
'';
installPhase =
''
mkdir -p $out/$qtPluginPrefix/styles
mv libphantomstyleplugin.so $out/$qtPluginPrefix/styles
'';
}; };
dontWrapQtApps = true;
buildInputs = [ prev.libsForQt5.qt5.qtbase ];
buildPhase = ''
cd src/styleplugin
qmake && make
'';
installPhase = ''
mkdir -p $out/$qtPluginPrefix/styles
mv libphantomstyleplugin.so $out/$qtPluginPrefix/styles
'';
};
} }

View File

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

View File

@ -1,5 +1,4 @@
_: prev: _: prev: let
let
pkgs = prev; pkgs = prev;
lib = pkgs.lib; lib = pkgs.lib;
vscodeWayland = vscodeWayland =
@ -16,36 +15,50 @@ let
"--disable-gpu-driver-bug-workarounds" "--disable-gpu-driver-bug-workarounds"
]; ];
in in
pkgs.writeScriptBin "vscode-wayland" '' pkgs.writeScriptBin
#!${pkgs.stdenv.shell} "vscode-wayland"
${pkgs.vscode}/bin/code ${lib.concatStringsSep " " flags} ''
''; #!${pkgs.stdenv.shell}
in ${pkgs.vscode}/bin/code ${lib.concatStringsSep " " flags}
{ '';
in {
vscodeWayland = vscodeWayland =
let let
pname = "vscode"; pname = "vscode";
desktop = pkgs.makeDesktopItem { desktop =
name = pname; pkgs.makeDesktopItem
exec = pname; {
icon = "vscode"; name = pname;
desktopName = "VSCode Wayland"; exec = pname;
}; icon = "vscode";
desktopName = "VSCode Wayland";
};
in in
lib.hiPrio (pkgs.stdenv.mkDerivation { lib.hiPrio
inherit pname; (
version = pkgs.vscode.version; pkgs.stdenv.mkDerivation
{
nativeBuildInputs = [ pkgs.makeWrapper ]; inherit pname;
phases = [ "installPhase" /*"fixupPhase"*/ ]; version = pkgs.vscode.version;
installPhase = '' nativeBuildInputs = [pkgs.makeWrapper];
mkdir -p $out/bin phases = [
install -m755 ${vscodeWayland}/bin/${pname}-wayland $out/bin/${pname} "installPhase"
cp -r ${desktop}/share $out/share /*
''; "fixupPhase"
/*fixupPhase = '' */
wrapProgram $out/bin/${pname} \ ];
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath (with pkgs; [ vulkan-loader vulkan-extension-layer libGL ])} installPhase =
'';*/ ''
}); mkdir -p $out/bin
install -m755 ${vscodeWayland}/bin/${pname}-wayland $out/bin/${pname}
cp -r ${desktop}/share $out/share
'';
/*
fixupPhase = ''
wrapProgram $out/bin/${pname} \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath (with pkgs; [ vulkan-loader vulkan-extension-layer libGL ])}
'';
*/
}
);
} }

View File

@ -1,16 +1,21 @@
# This file was generated by nvfetcher, please do not modify it manually. # This file was generated by nvfetcher, please do not modify it manually.
{ fetchgit, fetchurl }: {
fetchgit,
fetchurl,
}:
{ {
manix = { manix = {
pname = "manix"; pname = "manix";
version = "d08e7ca185445b929f097f8bfb1243a8ef3e10e4"; version = "d08e7ca185445b929f097f8bfb1243a8ef3e10e4";
src = fetchgit { src =
url = "https://github.com/mlvzk/manix"; fetchgit
rev = "d08e7ca185445b929f097f8bfb1243a8ef3e10e4"; {
fetchSubmodules = false; url = "https://github.com/mlvzk/manix";
deepClone = false; rev = "d08e7ca185445b929f097f8bfb1243a8ef3e10e4";
leaveDotGit = false; fetchSubmodules = false;
sha256 = "1b7xi8c2drbwzfz70czddc4j33s7g1alirv12dwl91hbqxifx8qs"; deepClone = false;
}; leaveDotGit = false;
sha256 = "1b7xi8c2drbwzfz70czddc4j33s7g1alirv12dwl91hbqxifx8qs";
};
}; };
} }

View File

@ -1,5 +1,5 @@
final: prev: { final: prev: {
# keep sources this first # keep sources this first
sources = prev.callPackage (import ./_sources/generated.nix) { }; sources = prev.callPackage (import ./_sources/generated.nix) {};
# then, call packages with `final.callPackage` # then, call packages with `final.callPackage`
} }

View File

@ -1,11 +1,14 @@
{ pkgs, lib, ... }: {
pkgs,
lib,
...
}:
let let
folder = ./.; folder = ./.;
toImport = name: value: folder + ("/" + name); toImport = name: value: folder + ("/" + name);
filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key && key != "default.nix"; filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key && key != "default.nix";
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.settings.substituters = ["https://cache.nixos.org/"];
} }

View File

@ -1,10 +1,6 @@
{ {
nix = { nix = {
binaryCaches = [ settings.substituters = ["https://harmony.cachix.org"];
"https://harmony.cachix.org" binaryCachePublicKeys = ["harmony.cachix.org-1:yv78QZHgS0UHkrMW56rccNghWHRz18fFRl8mWQ63M6E="];
];
binaryCachePublicKeys = [
"harmony.cachix.org-1:yv78QZHgS0UHkrMW56rccNghWHRz18fFRl8mWQ63M6E="
];
}; };
} }

View File

@ -1,10 +1,6 @@
{ {
nix = { nix = {
binaryCaches = [ settings.substituters = ["https://nix-cargo-integration.cachix.org"];
"https://nix-cargo-integration.cachix.org" binaryCachePublicKeys = ["nix-cargo-integration.cachix.org-1:wphySON/RyTC2DCzwKPBQGLEZv5mj0s1I1lsfQObaLs="];
];
binaryCachePublicKeys = [
"nix-cargo-integration.cachix.org-1:wphySON/RyTC2DCzwKPBQGLEZv5mj0s1I1lsfQObaLs="
];
}; };
} }

View File

@ -1,10 +1,6 @@
{ {
nix = { nix = {
binaryCaches = [ settings.substituters = ["https://nix-community.cachix.org"];
"https://nix-community.cachix.org" binaryCachePublicKeys = ["nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="];
];
binaryCachePublicKeys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
}; };
} }

View File

@ -1,10 +1,6 @@
{ {
nix = { nix = {
binaryCaches = [ settings.substituters = ["https://nixpkgs-wayland.cachix.org"];
"https://nixpkgs-wayland.cachix.org" binaryCachePublicKeys = ["nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="];
];
binaryCachePublicKeys = [
"nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA="
];
}; };
} }

View File

@ -1,10 +1,6 @@
{ {
nix = { nix = {
binaryCaches = [ settings.substituters = ["https://nrdxp.cachix.org"];
"https://nrdxp.cachix.org" binaryCachePublicKeys = ["nrdxp.cachix.org-1:Fc5PSqY2Jm1TrWfm88l6cvGWwz3s93c6IOifQWnhNW4="];
];
binaryCachePublicKeys = [
"nrdxp.cachix.org-1:Fc5PSqY2Jm1TrWfm88l6cvGWwz3s93c6IOifQWnhNW4="
];
}; };
} }

View File

@ -1,10 +1,6 @@
{ {
nix = { nix = {
binaryCaches = [ settings.substituters = ["https://veloren-nix.cachix.org"];
"https://veloren-nix.cachix.org" binaryCachePublicKeys = ["veloren-nix.cachix.org-1:zokfKJqVsNV6kI/oJdLF6TYBdNPYGSb+diMVQPn/5Rc="];
];
binaryCachePublicKeys = [
"veloren-nix.cachix.org-1:zokfKJqVsNV6kI/oJdLF6TYBdNPYGSb+diMVQPn/5Rc="
];
}; };
} }

View File

@ -1,98 +1,101 @@
{ self, inputs, config, pkgs, lib, ... }: {
self,
inputs,
config,
pkgs,
lib,
...
}:
let let
inherit (lib) fileContents mkIf; inherit (lib) fileContents mkIf;
pkgBin = lib.our.pkgBinNoDep pkgs; pkgBin = lib.our.pkgBinNoDep pkgs;
coreBin = v: "${pkgs.coreutils}/bin/${v}"; coreBin = v: "${pkgs.coreutils}/bin/${v}";
nixBin = "${config.nix.package}/bin/nix"; nixBin = "${config.nix.package}/bin/nix";
in in {
{ imports = [../cachix ../../locale];
imports = [ ../cachix ../../locale ];
boot = { boot = {
tmpOnTmpfs = true; tmpOnTmpfs = true;
loader.systemd-boot.configurationLimit = 10; loader.systemd-boot.configurationLimit = 10;
}; };
console.font = "7x14"; console.font = "7x14";
environment = { environment = {
systemPackages = with pkgs; [ systemPackages =
binutils with pkgs; [
coreutils binutils
curl coreutils
direnv curl
dnsutils direnv
dosfstools dnsutils
fd dosfstools
git fd
bottom git
gptfdisk bottom
iputils gptfdisk
jq iputils
manix jq
moreutils manix
nix-index moreutils
nmap nix-index
ripgrep nmap
skim ripgrep
tealdeer skim
usbutils tealdeer
utillinux usbutils
whois utillinux
bat whois
fzf bat
exa fzf
git exa
lm_sensors git
mkpasswd lm_sensors
ntfs3g mkpasswd
zoxide ntfs3g
bottom zoxide
amber bottom
unzip amber
unrar unzip
grit unrar
hydra-check grit
nix-index hydra-check
du-dust nix-index
mosh du-dust
( mosh
pkgs.runCommand "0x0.sh" { } '' (
mkdir -p $out/bin pkgs.runCommand
cp ${pkgs.fetchurl { "0x0.sh"
url = "https://raw.githubusercontent.com/Calinou/0x0/master/bin/0x0"; {}
sha256 = "sha256-Fad+AKBuA49qtRQfnroqjaNWeuRaCekXZG9sS9JVeaM="; ''
}} $out/bin/0x0 mkdir -p $out/bin
chmod +x $out/bin/0x0 cp ${
'' pkgs.fetchurl
) {
]; url = "https://raw.githubusercontent.com/Calinou/0x0/master/bin/0x0";
sha256 = "sha256-Fad+AKBuA49qtRQfnroqjaNWeuRaCekXZG9sS9JVeaM=";
}
} $out/bin/0x0
chmod +x $out/bin/0x0
''
)
];
shellAliases = shellAliases =
let ifSudo = string: mkIf config.security.sudo.enable string; let
in ifSudo = string: mkIf config.security.sudo.enable string;
{ in {
gtw = "${pkgBin "grit"} tree wnv"; gtw = "${pkgBin "grit"} tree wnv";
gtwa = "${pkgBin "grit"} add -p wnv"; gtwa = "${pkgBin "grit"} add -p wnv";
gt = pkgBin "grit"; gt = pkgBin "grit";
g = pkgBin "git"; g = pkgBin "git";
git-optimize = "${pkgBin "git"} gc --aggressive --prune=now"; git-optimize = "${pkgBin "git"} gc --aggressive --prune=now";
cat = "${pkgBin "bat"} -pp --theme=base16"; cat = "${pkgBin "bat"} -pp --theme=base16";
c = "cat"; c = "cat";
du = "${pkgs.du-dust}/bin/dust"; du = "${pkgs.du-dust}/bin/dust";
df = "${coreBin "df"} -h"; df = "${coreBin "df"} -h";
free = "${pkgs.procps}/bin/free -h"; free = "${pkgs.procps}/bin/free -h";
ls = pkgBin "exa"; ls = pkgBin "exa";
l = "${pkgBin "exa"} -lhg --git"; l = "${pkgBin "exa"} -lhg --git";
la = "${pkgBin "exa"} -lhg --git -a"; la = "${pkgBin "exa"} -lhg --git -a";
t = "${pkgBin "exa"} -lhg --git -T"; t = "${pkgBin "exa"} -lhg --git -T";
ta = "${pkgBin "exa"} -lhg --git -a -T"; ta = "${pkgBin "exa"} -lhg --git -a -T";
n = nixBin; n = nixBin;
nf = "${nixBin} flake"; nf = "${nixBin} flake";
nfc = "${nixBin} flake check"; nfc = "${nixBin} flake check";
@ -109,34 +112,25 @@ in
nsrp = "${nixBin} search nixpkgs"; nsrp = "${nixBin} search nixpkgs";
ndev = "${nixBin} develop"; ndev = "${nixBin} develop";
nrun = "${nixBin} run"; nrun = "${nixBin} run";
nrefs = "nix-store -qR"; nrefs = "nix-store -qR";
noscd = "cd /etc/nixos"; noscd = "cd /etc/nixos";
nosrs = ifSudo "sudo nixos-rebuild --fast switch"; nosrs = ifSudo "sudo nixos-rebuild --fast switch";
nosrb = ifSudo "sudo nixos-rebuild --fast boot"; nosrb = ifSudo "sudo nixos-rebuild --fast boot";
nosrt = ifSudo "sudo nixos-rebuild --fast test"; nosrt = ifSudo "sudo nixos-rebuild --fast test";
ngc = ifSudo "sudo nix-collect-garbage"; ngc = ifSudo "sudo nix-collect-garbage";
ngcdo = ifSudo "sudo nix-collect-garbage --delete-old"; ngcdo = ifSudo "sudo nix-collect-garbage --delete-old";
top = "${pkgs.bottom}/bin/btm"; top = "${pkgs.bottom}/bin/btm";
myip = "${pkgs.dnsutils}/bin/dig +short myip.opendns.com @208.67.222.222 2>&1";
myip =
"${pkgs.dnsutils}/bin/dig +short myip.opendns.com @208.67.222.222 2>&1";
mn = mn =
let manix_preview = "manix '{}' | sed 's/type: /> type: /g' | bat -l Markdown --color=always --plain"; in let
''manix "" | rg '^# ' | sed 's/^# \(.*\) (.*/\1/;s/ (.*//;s/^# //' | sk --preview="${manix_preview}" | xargs manix''; 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 # fix nixos-option
nixos-option = "nixos-option -I nixpkgs=${self}/lib/compat"; nixos-option = "nixos-option -I nixpkgs=${self}/lib/compat";
# sudo # sudo
s = ifSudo "sudo -E"; s = ifSudo "sudo -E";
si = ifSudo "sudo -i"; si = ifSudo "sudo -i";
se = ifSudo "sudoedit"; se = ifSudo "sudoedit";
# systemd # systemd
ctl = "systemctl"; ctl = "systemctl";
stl = ifSudo "s systemctl"; stl = ifSudo "s systemctl";
@ -148,49 +142,46 @@ in
jtl = "journalctl"; jtl = "journalctl";
}; };
}; };
system.activationScripts.diff =
system.activationScripts.diff = '' ''
${pkgs.nixUnstable}/bin/nix store \ ${pkgs.nixUnstable}/bin/nix store \
--experimental-features 'nix-command' \ --experimental-features 'nix-command' \
diff-closures /run/current-system "$systemConfig" diff-closures /run/current-system "$systemConfig"
''; '';
nix = nix =
let let
registry = registry =
builtins.removeAttrs builtins.removeAttrs
(builtins.mapAttrs (builtins.mapAttrs (_: v: { flake = v; }) (lib.filterAttrs (_: v: v ? outputs) inputs))
(_: v: { flake = v; }) ["bud"];
(lib.filterAttrs (_: v: v ? outputs) inputs)) in {
[ "bud" ];
in
{
package = pkgs.nixUnstable; package = pkgs.nixUnstable;
autoOptimiseStore = true;
gc.automatic = true; gc.automatic = true;
optimise.automatic = true; optimise.automatic = true;
useSandbox = true; extraOptions =
allowedUsers = [ "@wheel" ]; ''
trustedUsers = [ "root" "@wheel" ]; min-free = 536870912
extraOptions = '' keep-outputs = true
min-free = 536870912 keep-derivations = true
keep-outputs = true fallback = true
keep-derivations = true '';
fallback = true
'';
inherit registry; inherit registry;
settings = {
sandbox = true;
allowed-users = ["@wheel"];
trusted-users = ["root" "@wheel"];
auto-optimise-store = true;
};
}; };
programs.command-not-found.enable = false; programs.command-not-found.enable = false;
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
users.mutableUsers = false; users.mutableUsers = false;
# For rage encryption, all hosts need a ssh key pair # For rage encryption, all hosts need a ssh key pair
/*services.openssh = { /*
enable = true; services.openssh = {
openFirewall = lib.mkDefault false; enable = true;
};*/ openFirewall = lib.mkDefault false;
};
*/
services.earlyoom.enable = true; services.earlyoom.enable = true;
} }

View File

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

View File

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

View File

@ -1,15 +1,15 @@
{ pkgs, ... }: {
pkgs,
...
}:
let let
pkg = pkgs.helix; pkg = pkgs.helix;
bin = "${pkg}/bin/hx"; bin = "${pkg}/bin/hx";
in in {
{ environment.systemPackages = [pkg];
environment.systemPackages = [ pkg ];
environment.sessionVariables = { environment.sessionVariables = {
EDITOR = bin; EDITOR = bin;
VISUAL = bin; VISUAL = bin;
}; };
environment.shellAliases = { e = bin; }; environment.shellAliases = { e = bin; };
} }

View File

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

View File

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

View File

@ -1,10 +1,10 @@
{ {
imports = [ ./dns ]; imports = [./dns];
networking.dhcpcd.enable = false; networking.dhcpcd.enable = false;
networking.useDHCP = false; networking.useDHCP = false;
networking.dhcpcd.extraConfig = '' networking.dhcpcd.extraConfig =
noarp ''
nodelay noarp
''; nodelay
'';
} }

View File

@ -1,5 +1,4 @@
{ {
imports = [ ./nextdns.nix ]; imports = [./nextdns.nix];
networking.resolvconf.useLocalResolver = true; networking.resolvconf.useLocalResolver = true;
} }

View File

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

View File

@ -1,6 +1,5 @@
{ {
imports = [ ./nextdns.nix ]; imports = [./nextdns.nix];
networking.networkmanager.dns = "none"; networking.networkmanager.dns = "none";
services.stubby.enable = true; services.stubby.enable = true;
} }

View File

@ -2,9 +2,9 @@
services.stubby = { services.stubby = {
roundRobinUpstreams = false; roundRobinUpstreams = false;
upstreamServers = upstreamServers =
let nextDnsId = "75e43d"; let
in nextDnsId = "75e43d";
'' in ''
- address_data: 45.90.28.0 - address_data: 45.90.28.0
tls_auth_name: "${nextDnsId}.dns1.nextdns.io" tls_auth_name: "${nextDnsId}.dns1.nextdns.io"
- address_data: 2a07:a8c0::0 - address_data: 2a07:a8c0::0

View File

@ -1,6 +1,5 @@
{ {
imports = [ ./dns ]; imports = [./dns];
networking.wireless.iwd.enable = true; networking.wireless.iwd.enable = true;
networking.networkmanager.wifi.backend = "iwd"; networking.networkmanager.wifi.backend = "iwd";
services.connman.wifi.backend = "iwd"; services.connman.wifi.backend = "iwd";

View File

@ -1,5 +1,4 @@
{ {
imports = [ ../dns ]; imports = [../dns];
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
} }

View File

@ -1,6 +1,5 @@
{ {
imports = [ ./dns ]; imports = [./dns];
networking.wireless = { networking.wireless = {
enable = true; enable = true;
userControlled.enable = true; userControlled.enable = true;

Binary file not shown.

View File

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

View File

@ -1,61 +1,56 @@
{ pkgs, extraModulesPath, ... }: {
pkgs,
extraModulesPath,
...
}:
let let
hooks = import ./hooks; hooks = import ./hooks;
pkgWithCategory = category: package: { inherit package category; }; pkgWithCategory = category: package: { inherit package category; };
linter = pkgWithCategory "linter"; linter = pkgWithCategory "linter";
docs = pkgWithCategory "docs"; docs = pkgWithCategory "docs";
devos = pkgWithCategory "devos"; devos = pkgWithCategory "devos";
in {
in
{
_file = toString ./.; _file = toString ./.;
imports = ["${extraModulesPath}/git/hooks.nix"];
imports = [ "${extraModulesPath}/git/hooks.nix" ];
git = { inherit hooks; }; git = { inherit hooks; };
# tempfix: remove when merged https://github.com/numtide/devshell/pull/123 # tempfix: remove when merged https://github.com/numtide/devshell/pull/123
devshell.startup.load_profiles = pkgs.lib.mkForce (pkgs.lib.noDepEntry '' devshell.startup.load_profiles =
# PATH is devshell's exorbitant privilige: pkgs.lib.mkForce
# fence against its pollution (
_PATH=''${PATH} pkgs.lib.noDepEntry
# Load installed profiles ''
for file in "$DEVSHELL_DIR/etc/profile.d/"*.sh; do # PATH is devshell's exorbitant privilige:
# If that folder doesn't exist, bash loves to return the whole glob # fence against its pollution
[[ -f "$file" ]] && source "$file" _PATH=''${PATH}
done # Load installed profiles
# Exert exorbitant privilige and leave no trace for file in "$DEVSHELL_DIR/etc/profile.d/"*.sh; do
export PATH=''${_PATH} # If that folder doesn't exist, bash loves to return the whole glob
unset _PATH [[ -f "$file" ]] && source "$file"
''); done
# Exert exorbitant privilige and leave no trace
packages = with pkgs; [ export PATH=''${_PATH}
git-crypt unset _PATH
]; ''
);
commands = with pkgs; [ packages = with pkgs; [git-crypt];
(devos nixUnstable) commands =
#(devos agenix) with pkgs;
/*{ [
category = "devos"; (devos nixUnstable)
name = pkgs.nvfetcher-bin.pname; #(devos agenix)
help = pkgs.nvfetcher-bin.meta.description; /*
command = "cd $PRJ_ROOT/pkgs; ${pkgs.nvfetcher-bin}/bin/nvfetcher -c ./sources.toml $@"; {
}*/ category = "devos";
(linter nixpkgs-fmt) name = pkgs.nvfetcher-bin.pname;
(linter editorconfig-checker) help = pkgs.nvfetcher-bin.meta.description;
# (docs python3Packages.grip) too many deps command = "cd $PRJ_ROOT/pkgs; ${pkgs.nvfetcher-bin}/bin/nvfetcher -c ./sources.toml $@";
# (docs mdbook) }
] */
#(linter nixpkgs-fmt)
++ lib.optional #(linter editorconfig-checker)
(pkgs ? deploy-rs) # (docs python3Packages.grip) too many deps
(devos deploy-rs.deploy-rs) # (docs mdbook)
]
++ lib.optional ++ lib.optional (pkgs ? deploy-rs) (devos deploy-rs.deploy-rs)
(system != "i686-linux") ++ lib.optional (system != "i686-linux") (devos cachix);
(devos cachix)
;
} }

View File

@ -1,4 +1,4 @@
{ {
enable = true; enable = false;
pre-commit.text = builtins.readFile ./pre-commit.sh; pre-commit.text = builtins.readFile ./pre-commit.sh;
} }

View File

@ -5,6 +5,6 @@
password = "nixos"; password = "nixos";
description = "default"; description = "default";
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" ]; extraGroups = ["wheel"];
}; };
} }

View File

@ -1,36 +1,40 @@
{ config, pkgs, lib, ... }: {
config,
pkgs,
lib,
...
}:
let let
inherit (lib) mapAttrs' nameValuePair; inherit (lib) mapAttrs' nameValuePair;
inherit (builtins) readDir fetchGit; inherit (builtins) readDir fetchGit;
pkgBin = lib.our.pkgBinNoDep pkgs; pkgBin = lib.our.pkgBinNoDep pkgs;
nixosConfig = config; nixosConfig = config;
in in {
{
users.users.patriot = { users.users.patriot = {
isNormalUser = true; isNormalUser = true;
createHome = true; createHome = true;
home = "/home/patriot"; home = "/home/patriot";
extraGroups = [ "wheel" "adbusers" "dialout" /* "wireshark" */ ]; extraGroups = [
"wheel"
"adbusers"
"dialout"
/*
"wireshark"
*/
];
shell = pkgs.zsh; shell = pkgs.zsh;
hashedPassword = hashedPassword =
"$6$spzqhAyJfhHy$iHgLBlhjGn1l8PnbjJdWTn1GPvcjMqYNKUzdCe/7IrX6sHNgETSr/Nfpdmq9FCXLhrAfwHOd/q/8SvfeIeNX4/"; "$6$spzqhAyJfhHy$iHgLBlhjGn1l8PnbjJdWTn1GPvcjMqYNKUzdCe/7IrX6sHNgETSr/Nfpdmq9FCXLhrAfwHOd/q/8SvfeIeNX4/";
}; };
environment = { environment = {
systemPackages = [ pkgs.qt5.qtwayland ]; systemPackages = [pkgs.qt5.qtwayland];
shells = with pkgs; [ bashInteractive zsh ]; shells = with pkgs; [bashInteractive zsh];
}; };
xdg.portal = { xdg.portal = {
enable = true; enable = true;
gtkUsePortal = true; gtkUsePortal = true;
extraPortals = with pkgs; [ extraPortals = with pkgs; [xdg-desktop-portal xdg-desktop-portal-wlr];
xdg-desktop-portal
xdg-desktop-portal-wlr
];
}; };
programs = { programs = {
adb.enable = true; adb.enable = true;
steam.enable = true; steam.enable = true;
@ -40,7 +44,6 @@ in
}; };
wireshark.enable = false; wireshark.enable = false;
}; };
security = { security = {
pam.services.patriot = { pam.services.patriot = {
enableGnomeKeyring = true; enableGnomeKeyring = true;
@ -48,11 +51,13 @@ in
}; };
sudo.extraRules = [ sudo.extraRules = [
{ {
users = [ "patriot" ]; users = ["patriot"];
commands = [{ commands = [
command = "${pkgs.profile-sync-daemon}/bin/psd-overlay-helper"; {
options = [ "SETENV" "NOPASSWD" ]; command = "${pkgs.profile-sync-daemon}/bin/psd-overlay-helper";
}]; options = ["SETENV" "NOPASSWD"];
}
];
} }
]; ];
}; };
@ -86,32 +91,29 @@ in
}; };
}; };
}; };
systemd.user.services.gnome-session-restart-dbus.serviceConfig = { Slice = "-.slice"; };
systemd.user.services.gnome-session-restart-dbus.serviceConfig = {
Slice = "-.slice";
};
systemd = { systemd = {
targets = { targets = { network-online.enable = false; };
network-online.enable = false;
};
services = { services = {
systemd-networkd-wait-online.enable = false; systemd-networkd-wait-online.enable = false;
NetworkManager-wait-online.enable = false; NetworkManager-wait-online.enable = false;
}; };
}; };
home-manager.users.patriot = home-manager.users.patriot =
{ config, pkgs, suites, ... }: {
config,
pkgs,
suites,
...
}:
let let
personal = import ../../personal.nix; personal = import ../../personal.nix;
name = personal.name; name = personal.name;
email = personal.emails.primary; email = personal.emails.primary;
font = "Monoid";
font = "Iosevka Term"; fontSize = 10;
fontSize = 12;
fontComb = "${font} ${toString fontSize}"; fontComb = "${font} ${toString fontSize}";
fontPackage = pkgs.iosevka; fontPackage = pkgs.monoid;
colorSchemeLight = { colorSchemeLight = {
primary = { primary = {
normal = { normal = {
@ -146,7 +148,6 @@ in
white = "3a4d53"; white = "3a4d53";
}; };
}; };
colorSchemeDark = colorSchemeDark =
let let
normal = { normal = {
@ -171,10 +172,8 @@ in
cyan = "56d8c9"; cyan = "56d8c9";
white = "dedede"; white = "dedede";
}; };
in in {
{
inherit normal bright; inherit normal bright;
primary = { primary = {
normal = { normal = {
background = "181818"; background = "181818";
@ -186,16 +185,13 @@ in
}; };
}; };
}; };
colorScheme = colorScheme =
# if builtins.pathExists ./light then colorSchemeLight else colorSchemeDark; # if builtins.pathExists ./light then colorSchemeLight else colorSchemeDark;
colorSchemeDark; colorSchemeDark;
bgColor = colorScheme.primary.normal.background; bgColor = colorScheme.primary.normal.background;
fgColor = colorScheme.primary.bright.foreground; fgColor = colorScheme.primary.bright.foreground;
acColor = colorScheme.normal.yellow; acColor = colorScheme.normal.yellow;
acColor2 = colorScheme.normal.magenta; acColor2 = colorScheme.normal.magenta;
alacrittyColors = { alacrittyColors = {
primary = { primary = {
background = "0x${bgColor}"; background = "0x${bgColor}";
@ -204,7 +200,6 @@ in
normal = lib.mapAttrs (_: v: "0x${v}") colorScheme.normal; normal = lib.mapAttrs (_: v: "0x${v}") colorScheme.normal;
bright = lib.mapAttrs (_: v: "0x${v}") colorScheme.bright; bright = lib.mapAttrs (_: v: "0x${v}") colorScheme.bright;
}; };
# sway attrs reused # sway attrs reused
focusedWorkspace = { focusedWorkspace = {
background = "#${bgColor}"; background = "#${bgColor}";
@ -226,78 +221,73 @@ in
border = "#${acColor2}"; border = "#${acColor2}";
text = "#${acColor2}"; text = "#${acColor2}";
}; };
addIndSway = x: { addIndSway =
background = x.background; x: {
border = x.border; background = x.background;
childBorder = x.border; border = x.border;
text = x.text; childBorder = x.border;
indicator = "#111111"; # don't care text = x.text;
}; indicator = "#111111";
fonts = [ fontComb ]; # don't care
};
extraEnv = '' fonts = [fontComb];
export SDL_VIDEODRIVER=wayland extraEnv =
# needs qt5.qtwayland in systemPackages ''
export QT_QPA_PLATFORM=wayland export SDL_VIDEODRIVER=wayland
#export QT_WAYLAND_DISABLE_WINDOWDECORATION="1" # needs qt5.qtwayland in systemPackages
# Fix for some Java AWT applications (e.g. Android Studio), export QT_QPA_PLATFORM=wayland
# use this if they aren't displayed properly: #export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
export _JAVA_AWT_WM_NONREPARENTING=1 # Fix for some Java AWT applications (e.g. Android Studio),
#export QT_QPA_PLATFORMTHEME=qt5ct # use this if they aren't displayed properly:
#export QT_PLATFORM_PLUGIN=qt5ct export _JAVA_AWT_WM_NONREPARENTING=1
''; #export QT_QPA_PLATFORMTHEME=qt5ct
in #export QT_PLATFORM_PLUGIN=qt5ct
{ '';
in {
imports = suites.base; imports = suites.base;
# needs to be fixed to use nix profile??? # needs to be fixed to use nix profile???
/*gtk = { /*
enable = false; gtk = {
font = { enable = false;
package = pkgs.dejavu_fonts; font = {
name = "DejaVu Sans 12"; package = pkgs.dejavu_fonts;
}; name = "DejaVu Sans 12";
iconTheme = { };
package = pkgs.papirus-icon-theme; iconTheme = {
name = "Papirus Dark"; package = pkgs.papirus-icon-theme;
}; name = "Papirus Dark";
theme = { };
package = pkgs.numix-gtk-theme; theme = {
name = "Numix Dark"; package = pkgs.numix-gtk-theme;
}; name = "Numix Dark";
}; };
};
qt = {
enable = false; qt = {
style = { enable = false;
package = pkgs.adwaita-qt; style = {
name = "adwaita-dark"; package = pkgs.adwaita-qt;
}; name = "adwaita-dark";
};*/ };
};
*/
fonts.fontconfig.enable = true; fonts.fontconfig.enable = true;
home = { home = {
homeDirectory = nixosConfig.users.users.patriot.home; homeDirectory = nixosConfig.users.users.patriot.home;
packages = with pkgs; packages =
[ with pkgs; [
# Font stuff # Font stuff
fontPackage fontPackage
noto-fonts-cjk noto-fonts-cjk
font-awesome font-awesome
dejavu_fonts dejavu_fonts
(nerdfonts.override { fonts = [ "Iosevka" ]; }) (nerdfonts.override { fonts = ["Monoid"]; })
# Programs # Programs
#discord-canary-system
vulkan-tools vulkan-tools
audacity
krita krita
gimp
kdenlive
gnome3.seahorse gnome3.seahorse
gnome3.gnome-boxes
cachix cachix
appimage-run appimage-run
bitwarden
pfetch pfetch
gnupg gnupg
imv imv
@ -306,47 +296,63 @@ in
ffmpeg ffmpeg
mupdf mupdf
transmission-qt transmission-qt
(lib.hiPrio (lutris.overrideAttrs (old: { (
profile = '' lib.hiPrio
${old.profile or ""} (
unset VK_ICD_FILENAMES lutris.overrideAttrs
export VK_ICD_FILENAMES=${nixosConfig.environment.variables.VK_ICD_FILENAMES}''; (
}))) old: {
profile =
''
${old.profile or ""}
unset VK_ICD_FILENAMES
export VK_ICD_FILENAMES=${nixosConfig.environment.variables.VK_ICD_FILENAMES}'';
}
)
)
)
xdg_utils xdg_utils
tagref tagref
libreoffice-fresh
hydrus hydrus
papirus-icon-theme papirus-icon-theme
wl-clipboard wl-clipboard
rust-analyzer rust-analyzer
(lib.hiPrio (steam.override { (
extraLibraries = pkgs: [ pkgs.pipewire ]; lib.hiPrio
extraProfile = '' (
unset VK_ICD_FILENAMES steam.override
export VK_ICD_FILENAMES=${nixosConfig.environment.variables.VK_ICD_FILENAMES}''; {
})) extraLibraries = pkgs: [pkgs.pipewire];
/*(multimc.overrideAttrs (old: { extraProfile =
src = builtins.fetchGit { url = "https://github.com/AfoninZ/MultiMC5-Cracked.git"; ref = "develop"; rev = "9069e9c9d0b7951c310fdcc8bdc70ebc422a7634"; submodules = true; }; ''
}))*/ unset VK_ICD_FILENAMES
export VK_ICD_FILENAMES=${nixosConfig.environment.variables.VK_ICD_FILENAMES}'';
}
)
)
/*
(multimc.overrideAttrs (old: {
src = builtins.fetchGit { url = "https://github.com/AfoninZ/MultiMC5-Cracked.git"; ref = "develop"; rev = "9069e9c9d0b7951c310fdcc8bdc70ebc422a7634"; submodules = true; };
}))
*/
standardnotes
]; ];
}; };
wayland.windowManager = { wayland.windowManager = {
sway = { sway = {
enable = false; enable = false;
extraSessionCommands = extraEnv; extraSessionCommands = extraEnv;
wrapperFeatures.gtk = true; wrapperFeatures.gtk = true;
extraConfig = '' extraConfig =
exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway ''
''; exec dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=sway
'';
config = { config = {
fonts = { fonts = {
names = [ font ]; names = [font];
size = fontSize + 0.0; size = fontSize + 0.0;
}; };
bars = [{ bars = [{ command = "${pkgBin "waybar"}"; }];
command = "${pkgBin "waybar"}";
}];
colors = { colors = {
background = "#${bgColor}"; background = "#${bgColor}";
focused = addIndSway focusedWorkspace; focused = addIndSway focusedWorkspace;
@ -369,58 +375,54 @@ in
wf-recorder = pkgBin "wf-recorder"; wf-recorder = pkgBin "wf-recorder";
wl-copy = pkgs.wl-clipboard + "/bin/wl-copy"; wl-copy = pkgs.wl-clipboard + "/bin/wl-copy";
wl-paste = pkgs.wl-clipboard + "/bin/wl-paste"; wl-paste = pkgs.wl-clipboard + "/bin/wl-paste";
shotFile = config.home.homeDirectory shotFile = config.home.homeDirectory + "/shots/shot_$(date '+%Y_%m_%d_%H_%M')";
+ "/shots/shot_$(date '+%Y_%m_%d_%H_%M')";
in in
lib.mkOptionDefault { lib.mkOptionDefault
"${mod}+q" = "kill"; {
"${mod}+Shift+e" = "exit"; "${mod}+q" = "kill";
"${mod}+Shift+r" = "reload"; "${mod}+Shift+e" = "exit";
# Screenshot and copy it to clipboard "${mod}+Shift+r" = "reload";
"Mod1+s" = '' # Screenshot and copy it to clipboard
exec export SFILE="${shotFile}.png" && ${grim} "$SFILE" && ${cat} "$SFILE" | ${wl-copy} -t image/png "Mod1+s" =
''; ''
# Save selected area as a picture and copy it to clipboard exec export SFILE="${shotFile}.png" && ${grim} "$SFILE" && ${cat} "$SFILE" | ${wl-copy} -t image/png
"Mod1+Shift+s" = '' '';
exec export SFILE="${shotFile}.png" && ${grim} -g "$(${slurp})" "$SFILE" && ${cat} "$SFILE" | ${wl-copy} -t image/png # Save selected area as a picture and copy it to clipboard
''; "Mod1+Shift+s" =
# Record screen ''
"Mod1+r" = ''exec ${wf-recorder} -f "${shotFile}.mp4"''; exec export SFILE="${shotFile}.png" && ${grim} -g "$(${slurp})" "$SFILE" && ${cat} "$SFILE" | ${wl-copy} -t image/png
# Record an area '';
"Mod1+Shift+r" = # Record screen
''exec ${wf-recorder} -g "$(${slurp})" -f "${shotFile}.mp4"''; "Mod1+r" = ''exec ${wf-recorder} -f "${shotFile}.mp4"'';
# Stop recording # Record an area
"Mod1+c" = "exec pkill -INT wf-recorder"; "Mod1+Shift+r" = ''exec ${wf-recorder} -g "$(${slurp})" -f "${shotFile}.mp4"'';
"XF86AudioRaiseVolume" = "exec ${pactl} set-sink-volume 0 +5%"; # Stop recording
"XF86AudioLowerVolume" = "exec ${pactl} set-sink-volume 0 -5%"; "Mod1+c" = "exec pkill -INT wf-recorder";
"XF86AudioMute" = "exec ${pactl} set-sink-mute 0 toggle"; "XF86AudioRaiseVolume" = "exec ${pactl} set-sink-volume 0 +5%";
"XF86AudioPlay" = "exec ${playerctl} play-pause"; "XF86AudioLowerVolume" = "exec ${pactl} set-sink-volume 0 -5%";
"XF86AudioPrev" = "exec ${playerctl} previous"; "XF86AudioMute" = "exec ${pactl} set-sink-mute 0 toggle";
"XF86AudioNext" = "exec ${playerctl} next"; "XF86AudioPlay" = "exec ${playerctl} play-pause";
"XF86AudioStop" = "exec ${playerctl} stop"; "XF86AudioPrev" = "exec ${playerctl} previous";
}; "XF86AudioNext" = "exec ${playerctl} next";
"XF86AudioStop" = "exec ${playerctl} stop";
};
input = { input = {
"*" = { "*" = {
xkb_layout = nixosConfig.services.xserver.layout; xkb_layout = nixosConfig.services.xserver.layout;
accel_profile = "flat"; accel_profile = "flat";
}; };
}; };
output = { output = { "*" = { bg = config.home.homeDirectory + "/wallpaper.png" + " fill"; }; };
"*" = {
bg = config.home.homeDirectory + "/wallpaper.png" + " fill";
};
};
}; };
}; };
}; };
programs = { programs = {
alacritty = { alacritty = {
enable = true; enable = true;
settings = { settings = {
shell = { shell = {
program = "${pkgs.tmux}/bin/tmux"; program = "${pkgs.tmux}/bin/tmux";
args = [ "attach" ]; args = ["attach"];
}; };
font = { font = {
normal = { family = font; }; normal = { family = font; };
@ -437,24 +439,33 @@ in
escapeTime = 0; escapeTime = 0;
keyMode = "vi"; keyMode = "vi";
shortcut = "a"; shortcut = "a";
extraConfig = '' extraConfig =
set -g default-terminal "alacritty" ''
set -ga terminal-overrides ",alacritty:Tc" set -g default-terminal "alacritty"
set -g status off set -ga terminal-overrides ",alacritty:Tc"
''; set -g status off
'';
}; };
chromium = { chromium = {
enable = true; enable = true;
package = pkgs.chromium; package = pkgs.chromium;
extensions = [ extensions = [
"gcbommkclmclpchllfjekcdonpmejbdp" # https everywhere "gcbommkclmclpchllfjekcdonpmejbdp"
"cjpalhdlnbpafiamejdnhcphjbkeiagm" # ublock # https everywhere
"nngceckbapebfimnlniiiahkandclblb" # bitwarden "cjpalhdlnbpafiamejdnhcphjbkeiagm"
"ldpochfccmkkmhdbclfhpagapcfdljkj" # decentraleyes # ublock
"annfbnbieaamhaimclajlajpijgkdblo" # dark theme "nngceckbapebfimnlniiiahkandclblb"
"eimadpbcbfnmbkopoojfekhnkhdbieeh" # dark reader # bitwarden
"hlepfoohegkhhmjieoechaddaejaokhf" # github refined "ldpochfccmkkmhdbclfhpagapcfdljkj"
"pmcmeagblkinmogikoikkdjiligflglb" # privacy redirect # decentraleyes
"annfbnbieaamhaimclajlajpijgkdblo"
# dark theme
"eimadpbcbfnmbkopoojfekhnkhdbieeh"
# dark reader
"hlepfoohegkhhmjieoechaddaejaokhf"
# github refined
"pmcmeagblkinmogikoikkdjiligflglb"
# privacy redirect
]; ];
}; };
qutebrowser = { qutebrowser = {
@ -480,11 +491,11 @@ in
"youtube.com" "youtube.com"
"docker.com" "docker.com"
]; ];
enableJsForDomain = d: '' enableJsForDomain =
config.set('content.javascript.enabled', True, 'https://*.${d}') d: ''
''; config.set('content.javascript.enabled', True, 'https://*.${d}')
in '';
'' in ''
${lib.concatStrings (map enableJsForDomain domains)} ${lib.concatStrings (map enableJsForDomain domains)}
''; '';
}; };
@ -520,55 +531,63 @@ in
plugins = plugins =
let let
fast-syntax-highlighting = fast-syntax-highlighting =
let name = "fast-syntax-highlighting"; in let
{ name = "fast-syntax-highlighting";
in {
inherit name; inherit name;
src = pkgs."zsh-${name}".out; src = pkgs."zsh-${name}".out;
}; };
per-directory-history = { per-directory-history = {
name = "per-directory-history"; name = "per-directory-history";
src = pkgs.fetchFromGitHub { src =
owner = "jimhester"; pkgs.fetchFromGitHub
repo = "per-directory-history"; {
rev = "d2e291dd6434e340d9be0e15e1f5b94f32771c06"; owner = "jimhester";
hash = "sha256-VHRgrVCqzILqOes8VXGjSgLek38BFs9eijmp0JHtD5Q="; repo = "per-directory-history";
}; rev = "d2e291dd6434e340d9be0e15e1f5b94f32771c06";
hash = "sha256-VHRgrVCqzILqOes8VXGjSgLek38BFs9eijmp0JHtD5Q=";
};
}; };
in in [fast-syntax-highlighting per-directory-history];
[ fast-syntax-highlighting per-directory-history ];
# xdg compliant # xdg compliant
dotDir = ".config/zsh"; dotDir = ".config/zsh";
history.path = ".local/share/zsh/history"; history.path = ".local/share/zsh/history";
envExtra = extraEnv; envExtra = extraEnv;
/*loginExtra = /*
loginExtra =
''
if [ "$(${pkgs.coreutils}/bin/tty)" = "/dev/tty1" ]; then
exec sway
fi
'';
*/
initExtra =
'' ''
if [ "$(${pkgs.coreutils}/bin/tty)" = "/dev/tty1" ]; then export TERM=alacritty
exec sway export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
fi
'';*/
initExtra = ''
export TERM=alacritty
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
function tomp4 () { function tomp4 () {
${pkgs.ffmpeg}/bin/ffmpeg -i $1 -c:v libx264 -preset slow -crf 30 -c:a aac -b:a 128k "$1.mp4" ${pkgs.ffmpeg}/bin/ffmpeg -i $1 -c:v libx264 -preset slow -crf 30 -c:a aac -b:a 128k "$1.mp4"
} }
function topng () { function topng () {
${pkgs.ffmpeg}/bin/ffmpeg -i $1 "$1.png" ${pkgs.ffmpeg}/bin/ffmpeg -i $1 "$1.png"
} }
bindkey "$terminfo[kRIT5]" forward-word bindkey "$terminfo[kRIT5]" forward-word
bindkey "$terminfo[kLFT5]" backward-word bindkey "$terminfo[kLFT5]" backward-word
zstyle ':completion:*' menu select zstyle ':completion:*' menu select
eval "$(zoxide init zsh)" eval "$(zoxide init zsh)"
'';
shellAliases = nixosConfig.environment.shellAliases // {
harmony-ssh = ''
${pkgs.mosh}/bin/mosh root@chat.harmonyapp.io
''; '';
}; shellAliases =
nixosConfig.environment.shellAliases
// {
harmony-ssh =
''
${pkgs.mosh}/bin/mosh root@chat.harmonyapp.io
'';
};
}; };
fzf.enable = true; fzf.enable = true;
rofi = rofi =
@ -576,8 +595,7 @@ in
bgc = "#${bgColor}"; bgc = "#${bgColor}";
fgc = "#${fgColor}"; fgc = "#${fgColor}";
acc = "#${acColor}"; acc = "#${acColor}";
in in {
{
enable = false; enable = false;
cycle = true; cycle = true;
font = fontComb; font = fontComb;
@ -588,39 +606,68 @@ in
package = pkgs.vscodeWayland; package = pkgs.vscodeWayland;
extensions = extensions =
let let
mkExt = n: v: p: s: { name = n; version = v; publisher = p; sha256 = s; }; mkExt =
n: v: p: s: {
name = n;
version = v;
publisher = p;
sha256 = s;
};
in in
(pkgs.vscode-utils.extensionsFromVscodeMarketplace [ (
# Rust pkgs.vscode-utils.extensionsFromVscodeMarketplace
(mkExt "rust-analyzer" "0.2.760" "matklad" "sha256-M+eFqIFwiKkiwqFRwkX5h6mc/W+NBqkXcNUdTewwkCI=") [
(mkExt "even-better-toml" "0.14.2" "tamasfe" "sha256-lE2t+KUfClD/xjpvexTJlEr7Kufo+22DUM9Ju4Tisp0=") # Rust
(mkExt "crates" "0.5.9" "serayuzgur" "sha256-YHIbnl2R7lqwJHi8qUQImClx9MWm+5Pc12vYw7e/RlA=") (mkExt "rust-analyzer" "0.2.760" "matklad" "sha256-M+eFqIFwiKkiwqFRwkX5h6mc/W+NBqkXcNUdTewwkCI=")
# Nix (mkExt "even-better-toml" "0.14.2" "tamasfe" "sha256-lE2t+KUfClD/xjpvexTJlEr7Kufo+22DUM9Ju4Tisp0=")
(mkExt "nix-env-selector" "1.0.7" "arrterian" "sha256-DnaIXJ27bcpOrIp1hm7DcrlIzGSjo4RTJ9fD72ukKlc=") (mkExt "crates" "0.5.9" "serayuzgur" "sha256-YHIbnl2R7lqwJHi8qUQImClx9MWm+5Pc12vYw7e/RlA=")
# Go # Nix
(mkExt "Go" "0.25.1" "golang" "sha256-ZDUWN9lzDnR77W7xcMFQaaFl/6Lf/x1jgaBkwZPqGGw=") (
# Flutter and dart mkExt "nix-env-selector" "1.0.7" "arrterian" "sha256-DnaIXJ27bcpOrIp1hm7DcrlIzGSjo4RTJ9fD72ukKlc="
(mkExt "flutter" "3.22.0" "Dart-Code" "sha256-woygN6hOWlP2UayqwDhJh9KcZk1GzH7mDF5IueDRxs4=") )
(mkExt "dart-code" "3.22.0" "Dart-Code" "sha256-1nTewVmlrxbXdRR1EPts46u24LHdnP5BblFsMaGlNYg=") # Go
# protobuf (mkExt "Go" "0.25.1" "golang" "sha256-ZDUWN9lzDnR77W7xcMFQaaFl/6Lf/x1jgaBkwZPqGGw=")
(mkExt "vscode-proto3" "0.5.4" "zxh404" "sha256-S89qRRlfiTsJ+fJuwdNkZywe6mei48KxIEWbGWChriE=") # Flutter and dart
(mkExt "vscode-buf" "0.3.1" "bufbuild" "sha256-KjU6WlDxYPPJjh45mCq6Kczi6odYwnLaGj4RHe3fc2w=") (mkExt "flutter" "3.22.0" "Dart-Code" "sha256-woygN6hOWlP2UayqwDhJh9KcZk1GzH7mDF5IueDRxs4=")
# git (mkExt "dart-code" "3.22.0" "Dart-Code" "sha256-1nTewVmlrxbXdRR1EPts46u24LHdnP5BblFsMaGlNYg=")
(mkExt "gitlens" "11.6.0" "eamodio" "sha256-JxCNE/IL/v94xWmhebsRZo1Gw+nSSpDgZ41ZGongGVI=") # protobuf
(mkExt "vscode-commitizen" "0.14.1" "KnisterPeter" "sha256-yw8XKGL7Ul9wV+C0yL1LFJCE3+E8u/sR9s3TjkGJPZM=") (mkExt "vscode-proto3" "0.5.4" "zxh404" "sha256-S89qRRlfiTsJ+fJuwdNkZywe6mei48KxIEWbGWChriE=")
# Customization (mkExt "vscode-buf" "0.3.1" "bufbuild" "sha256-KjU6WlDxYPPJjh45mCq6Kczi6odYwnLaGj4RHe3fc2w=")
# (mkExt "dance" "0.3.2" "gregoire" "sha256-+g8EXeCkPOPvZ60JoXkGTeSXYWrXmKrcbUaEfDppdgA=") # git
(mkExt "material-icon-theme" "4.6.0" "PKief" "sha256-i+3lrw3mDqK2vTMDhJYTACW5JleA+lN1XAC2imgQLUo=") (mkExt "gitlens" "11.6.0" "eamodio" "sha256-JxCNE/IL/v94xWmhebsRZo1Gw+nSSpDgZ41ZGongGVI=")
(mkExt "github-vscode-theme" "4.1.1" "GitHub" "sha256-yLySHOx6pe7w2cyi95pQlKkn/o4VMCTkrTYHu8ASn5M=") (
(mkExt "koka" "0.0.1" "maelvalais" "sha256-ty8Mql19HgUWForggeZuHQpzTbmmB/eBFHqof5ZMKr0=") mkExt
(mkExt "vscode-rhai" "0.6.3" "rhaiscript" "sha256-gEdpM/TkkiZ50bG9qDU6BH04AJLRDcHLquniRs6m0mg=") "vscode-commitizen"
(mkExt "copilot" "1.2.1991" "GitHub" "sha256-pGb5xfjuy+g646doZEuKhQalkOte5dH+I+1op+vZY48=") "0.14.1"
]) ++ (with pkgs.vscode-extensions; [ a5huynh.vscode-ron /* vadimcn.vscode-lldb */ jnoortheen.nix-ide ]); "KnisterPeter"
"sha256-yw8XKGL7Ul9wV+C0yL1LFJCE3+E8u/sR9s3TjkGJPZM="
)
# 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=")
]
)
++ (
with pkgs.vscode-extensions; [
a5huynh.vscode-ron
/*
vadimcn.vscode-lldb
*/
jnoortheen.nix-ide
]
);
userSettings = { userSettings = {
"workbench.iconTheme" = "material-icon-theme"; "workbench.iconTheme" = "material-icon-theme";
"workbench.colorTheme" = "GitHub Dark"; "workbench.colorTheme" = "GitHub Dark";
"rust-analyzer.cargo.loadOutDirsFromCheck" = true; "rust-analyzer.cargo.loadOutDirsFromCheck" = true;
"rust-analyzer.procMacro.enable" = true; "rust-analyzer.procMacro.enable" = true;
"rust-analyzer.server.path" = "${pkgs.rust-analyzer}/bin/rust-analyzer";
"rust-analyzer.updates.channel" = "nightly"; "rust-analyzer.updates.channel" = "nightly";
"editor.fontFamily" = "'${font}'"; "editor.fontFamily" = "'${font}'";
"debug.console.fontFamily" = "${font}"; "debug.console.fontFamily" = "${font}";
@ -634,117 +681,124 @@ in
}; };
}; };
}; };
services = { services = {
gpg-agent = gpg-agent =
let let
defaultCacheTtl = 3600 * 6; defaultCacheTtl = 3600 * 6;
maxCacheTtl = 3600 * 24; maxCacheTtl = 3600 * 24;
in in {
{
inherit defaultCacheTtl maxCacheTtl; inherit defaultCacheTtl maxCacheTtl;
enable = true; enable = true;
enableSshSupport = true; enableSshSupport = true;
sshKeys = [ "8369D9CA26C3EAAAB8302A88CEE6FD14B58AA965" ]; sshKeys = ["8369D9CA26C3EAAAB8302A88CEE6FD14B58AA965"];
defaultCacheTtlSsh = defaultCacheTtl; defaultCacheTtlSsh = defaultCacheTtl;
maxCacheTtlSsh = maxCacheTtl; maxCacheTtlSsh = maxCacheTtl;
grabKeyboardAndMouse = false; grabKeyboardAndMouse = false;
pinentryFlavor = "qt"; pinentryFlavor = "qt";
}; };
}; };
xdg = { xdg = {
enable = true; enable = true;
configFile = { configFile = {
"helix/themes/mytheme.toml".text = '' "helix/themes/mytheme.toml".text =
"attribute" = { fg = "#${colorScheme.bright.yellow}]" } ''
"comment" = { fg = "#${colorScheme.normal.gray}", modifiers = ['italic'] } "attribute" = { fg = "#${colorScheme.bright.yellow}]" }
"constant" = { fg = "#${colorScheme.normal.blue}" } "comment" = { fg = "#${colorScheme.normal.gray}", modifiers = ['italic'] }
"constant.builtin" = { fg = "#${colorScheme.bright.blue}" } "constant" = { fg = "#${colorScheme.normal.blue}" }
"constructor" = { fg = "#${colorScheme.bright.blue}" } "constant.builtin" = { fg = "#${colorScheme.bright.blue}" }
"escape" = { fg = "#${colorScheme.bright.yellow}" } "constructor" = { fg = "#${colorScheme.bright.blue}" }
"function" = { fg = "#${colorScheme.bright.blue}" } "escape" = { fg = "#${colorScheme.bright.yellow}" }
"function.builtin" = { fg = "#${colorScheme.bright.blue}" } "function" = { fg = "#${colorScheme.bright.blue}" }
"function.macro" = { fg = "#${colorScheme.bright.magenta}" } "function.builtin" = { fg = "#${colorScheme.bright.blue}" }
"keyword" = { fg = "#${colorScheme.normal.magenta}", modifiers = ['italic'] } "function.macro" = { fg = "#${colorScheme.bright.magenta}" }
"keyword.directive" = { fg = "#${colorScheme.normal.magenta}" } "keyword" = { fg = "#${colorScheme.normal.magenta}", modifiers = ['italic'] }
"label" = { fg = "#${colorScheme.bright.magenta}" } "keyword.directive" = { fg = "#${colorScheme.normal.magenta}" }
"namespace" = { fg = "#${colorScheme.bright.blue}" } "label" = { fg = "#${colorScheme.bright.magenta}" }
"number" = { fg = "#${colorScheme.normal.cyan}" } "namespace" = { fg = "#${colorScheme.bright.blue}" }
"operator" = { fg = "#${colorScheme.bright.magenta}", modifiers = ['italic'] } "number" = { fg = "#${colorScheme.normal.cyan}" }
"property" = { fg = "#${colorScheme.normal.red}" } "operator" = { fg = "#${colorScheme.bright.magenta}", modifiers = ['italic'] }
"special" = { fg = "#${colorScheme.bright.blue}" } "property" = { fg = "#${colorScheme.normal.red}" }
"string" = { fg = "#${colorScheme.normal.green}" } "special" = { fg = "#${colorScheme.bright.blue}" }
"type" = { fg = "#${colorScheme.normal.cyan}", modifiers = ['bold'] } "string" = { fg = "#${colorScheme.normal.green}" }
"type.builtin" = { fg = "#${colorScheme.normal.cyan}", modifiers = ['bold'] } "type" = { fg = "#${colorScheme.normal.cyan}", modifiers = ['bold'] }
"variable" = { fg = "#${colorScheme.bright.blue}", modifiers = ['italic'] } "type.builtin" = { fg = "#${colorScheme.normal.cyan}", modifiers = ['bold'] }
"variable.builtin" = { fg = "#${colorScheme.bright.blue}", modifiers = ['italic'] } "variable" = { fg = "#${colorScheme.bright.blue}", modifiers = ['italic'] }
"variable.parameter" = { fg = "#${colorScheme.bright.red}", modifiers = ['italic'] } "variable.builtin" = { fg = "#${colorScheme.bright.blue}", modifiers = ['italic'] }
"ui.menu.selected" = { fg = "#${bgColor}", bg = "#${acColor}" } "variable.parameter" = { fg = "#${colorScheme.bright.red}", modifiers = ['italic'] }
"ui.background" = { fg = "#${fgColor}", bg = "#${bgColor}" } "ui.menu.selected" = { fg = "#${bgColor}", bg = "#${acColor}" }
"ui.help" = { bg = "#${colorScheme.normal.black}" } "ui.background" = { fg = "#${fgColor}", bg = "#${bgColor}" }
"ui.linenr" = { fg = "#${colorScheme.primary.bright.background}", modifiers = ['bold'] } "ui.help" = { bg = "#${colorScheme.normal.black}" }
"ui.linenr.selected" = { fg = "#${fgColor}", modifiers = ['bold'] } "ui.linenr" = { fg = "#${colorScheme.primary.bright.background}", modifiers = ['bold'] }
"ui.popup" = { bg = "#${colorScheme.normal.black}" } "ui.linenr.selected" = { fg = "#${fgColor}", modifiers = ['bold'] }
"ui.statusline" = { fg = "#${fgColor}", bg = "#${bgColor}" } "ui.popup" = { bg = "#${colorScheme.normal.black}" }
"ui.statusline.inactive" = { fg = "#${fgColor}", bg = "#${bgColor}" } "ui.statusline" = { fg = "#${fgColor}", bg = "#${bgColor}" }
"ui.selection" = { bg = "#${colorScheme.primary.bright.background}" } "ui.statusline.inactive" = { fg = "#${fgColor}", bg = "#${bgColor}" }
"ui.text" = { fg = "#${fgColor}", bg = "#${bgColor}" } "ui.selection" = { bg = "#${colorScheme.primary.bright.background}" }
"ui.text.focus" = { fg = "#${fgColor}", bg = "#${bgColor}", modifiers = ['bold'] } "ui.text" = { fg = "#${fgColor}", bg = "#${bgColor}" }
"ui.window" = { bg = "#${bgColor}" } "ui.text.focus" = { fg = "#${fgColor}", bg = "#${bgColor}", modifiers = ['bold'] }
"ui.cursor.primary" = { fg = "#${fgColor}", modifiers = ["reversed"] } "ui.window" = { bg = "#${bgColor}" }
"ui.cursor.primary" = { fg = "#${fgColor}", modifiers = ["reversed"] }
"info" = { fg = "#${colorScheme.normal.blue}", modifiers = ['bold'] } "info" = { fg = "#${colorScheme.normal.blue}", modifiers = ['bold'] }
"hint" = { fg = "#${colorScheme.bright.green}", modifiers = ['bold'] } "hint" = { fg = "#${colorScheme.bright.green}", modifiers = ['bold'] }
"warning" = { fg = "#${colorScheme.normal.yellow}", modifiers = ['bold'] } "warning" = { fg = "#${colorScheme.normal.yellow}", modifiers = ['bold'] }
"error" = { fg = "#${colorScheme.bright.red}", modifiers = ['bold'] } "error" = { fg = "#${colorScheme.bright.red}", modifiers = ['bold'] }
''; '';
"helix/config.toml".text = '' "helix/config.toml".text =
theme = "mytheme" ''
[editor] theme = "mytheme"
line-number = "relative" [editor]
[lsp] line-number = "relative"
display-messages = true [lsp]
''; display-messages = true
"helix/languages.toml".text = '' '';
[[language]] "helix/languages.toml".text =
name = "nix" ''
language-server = { command = "${pkgBin "rnix-lsp"}" } [[language]]
''; name = "nix"
language-server = { command = "${pkgBin "rnix-lsp"}" }
'';
"waybar/config".text = "waybar/config".text =
let swayEnabled = config.wayland.windowManager.sway.enable; in let
builtins.toJSON { swayEnabled = config.wayland.windowManager.sway.enable;
layer = "top"; in
position = "top"; builtins.toJSON
modules-left = if swayEnabled then [ "sway/workspaces" ] else [ ]; {
modules-center = if swayEnabled then [ "sway/window" ] else [ ]; layer = "top";
modules-right = position = "top";
[ "pulseaudio" "cpu" "memory" "temperature" "clock" "tray" ]; modules-left =
tray = { spacing = 8; }; if swayEnabled
cpu = { format = "/cpu {usage}/"; }; then ["sway/workspaces"]
memory = { format = "/mem {}/"; }; else [];
temperature = { modules-center =
hwmon-path = "/sys/class/hwmon/hwmon1/temp2_input"; if swayEnabled
format = "/tmp {temperatureC}C/"; then ["sway/window"]
else [];
modules-right = ["pulseaudio" "cpu" "memory" "temperature" "clock" "tray"];
tray = { spacing = 8; };
cpu = { format = "/cpu {usage}/"; };
memory = { format = "/mem {}/"; };
temperature = {
hwmon-path = "/sys/class/hwmon/hwmon1/temp2_input";
format = "/tmp {temperatureC}C/";
};
pulseaudio = {
format = "/vol {volume}/ {format_source}";
format-bluetooth = "/volb {volume}/ {format_source}";
format-bluetooth-muted = "/volb/ {format_source}";
format-muted = "/vol/ {format_source}";
format-source = "/mic {volume}/";
format-source-muted = "/mic/";
};
}; };
pulseaudio = {
format = "/vol {volume}/ {format_source}";
format-bluetooth = "/volb {volume}/ {format_source}";
format-bluetooth-muted = "/volb/ {format_source}";
format-muted = "/vol/ {format_source}";
format-source = "/mic {volume}/";
format-source-muted = "/mic/";
};
};
"waybar/style.css".text = "waybar/style.css".text =
let let
makeBorder = color: "border-bottom: 3px solid #${color};"; makeBorder = color: "border-bottom: 3px solid #${color};";
makeInfo = color: '' makeInfo =
color: #${color}; color: ''
${makeBorder color} color: #${color};
''; ${makeBorder color}
'';
clockColor = colorScheme.bright.magenta; clockColor = colorScheme.bright.magenta;
cpuColor = colorScheme.bright.green; cpuColor = colorScheme.bright.green;
memColor = colorScheme.bright.blue; memColor = colorScheme.bright.blue;
@ -756,8 +810,7 @@ in
normal = colorScheme.bright.yellow; normal = colorScheme.bright.yellow;
critical = colorScheme.bright.red; critical = colorScheme.bright.red;
}; };
in in ''
''
* { * {
border: none; border: none;
border-radius: 0; border-radius: 0;

View File

@ -25,22 +25,17 @@
ssp = "stash pop"; ssp = "stash pop";
ssl = "stash list"; ssl = "stash list";
ssd = "stash drop"; ssd = "stash drop";
# reset # reset
rsoft = "reset --soft"; rsoft = "reset --soft";
rhard = "reset --hard"; rhard = "reset --hard";
rs1ft = "soft HEAD~1"; rs1ft = "soft HEAD~1";
rh1rd = "hard HEAD~1"; rh1rd = "hard HEAD~1";
# logging # logging
l = l =
"log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"; "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit";
plog = plog = "log --graph --pretty='format:%C(red)%d%C(reset) %C(yellow)%h%C(reset) %ar %C(green)%aN%C(reset) %s'";
"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";
tlog =
"log --stat --since='1 Day Ago' --graph --pretty=oneline --abbrev-commit --date=relative";
rank = "shortlog -sn --no-merges"; rank = "shortlog -sn --no-merges";
# delete merged branches # delete merged branches
bdm = "!git branch --merged | grep -v '*' | xargs -n 1 git branch -d"; bdm = "!git branch --merged | grep -v '*' | xargs -n 1 git branch -d";
}; };

View File

@ -1,197 +1,205 @@
{ fontComb ? "Iosevka 10", config, pkgs, ... }:
{ {
home.packages = with pkgs; [ hikari xwayland ]; fontComb ? "Iosevka 10",
config,
pkgs,
...
}:
{
home.packages = with pkgs; [hikari xwayland];
xdg = { xdg = {
enable = true; enable = true;
configFile = { configFile = {
"hikari/hikari.conf".text = '' "hikari/hikari.conf".text =
ui { ''
border = 1 ui {
gap = 0 border = 1
step = 120 gap = 0
font = "${fontComb}" step = 120
font = "${fontComb}"
colorscheme { colorscheme {
background = 0x282C34 background = 0x282C34
foreground = 0x000000 foreground = 0x000000
selected = 0xF5E094 selected = 0xF5E094
grouped = 0xFDAF53 grouped = 0xFDAF53
first = 0xB8E673 first = 0xB8E673
conflict = 0xED6B32 conflict = 0xED6B32
insert = 0xE3C3FA insert = 0xE3C3FA
active = 0xFFFFFF active = 0xFFFFFF
inactive = 0x465457 inactive = 0x465457
}
} }
}
outputs { outputs {
"*" {
background = "${config.home.homeDirectory}/wallpaper.png"
}
}
inputs {
keyboards {
"*" { "*" {
xkb = { background = "${config.home.homeDirectory}/wallpaper.png"
layout = "tr" }
}
inputs {
keyboards {
"*" {
xkb = {
layout = "tr"
}
}
}
pointers {
"*" {
accel-profile = "flat"
} }
} }
} }
pointers {
"*" { layouts {
accel-profile = "flat" # main stack
s = {
scale = {
min = 0.5
max = 0.75
}
left = single
right = stack
}
# main queue
q = {
scale = 0.75
top = single
bottom = queue
}
f = full
h = stack
v = queue
g = grid
}
actions {
terminal = "${pkgs.alacritty}/bin/alacritty"
run = "${pkgs.wofi}/bin/wofi --show drun"
}
bindings {
keyboard {
"L+0" = workspace-switch-to-sheet-0
"L+1" = workspace-switch-to-sheet-1
"L+2" = workspace-switch-to-sheet-2
"L+3" = workspace-switch-to-sheet-3
"L+4" = workspace-switch-to-sheet-4
"L+5" = workspace-switch-to-sheet-5
"L+6" = workspace-switch-to-sheet-6
"L+7" = workspace-switch-to-sheet-7
"L+8" = workspace-switch-to-sheet-8
"L+9" = workspace-switch-to-sheet-9
"L+numbersign" = workspace-switch-to-sheet-alternate
"L+Period" = workspace-switch-to-sheet-current
"L+j" = workspace-switch-to-sheet-next
"L+k" = workspace-switch-to-sheet-prev
"L+Comma" = workspace-switch-to-sheet-next-inhabited
"LS+Comma" = workspace-switch-to-sheet-prev-inhabited
"LSC+g" = workspace-show-group
"LSC+i" = workspace-show-invisible
"LSC+Period" = workspace-show-all
"LC+n" = workspace-cycle-next
"LC+p" = workspace-cycle-prev
"LC+i" = sheet-show-invisible
"LC+Period" = sheet-show-all
"LC+g" = sheet-show-group
"LA+r" = layout-reset
"LA+Return" = layout-restack-append
"LAS+Return" = layout-restack-prepend
"L+Home" = layout-cycle-view-first
"L+End" = layout-cycle-view-last
"L+n" = layout-cycle-view-next
"L+p" = layout-cycle-view-prev
"L+x" = layout-exchange-view-next
"LS+x" = layout-exchange-view-prev
"LA+x" = layout-exchange-view-main
"LS+0" = view-pin-to-sheet-0
"LS+1" = view-pin-to-sheet-1
"LS+2" = view-pin-to-sheet-2
"LS+3" = view-pin-to-sheet-3
"LS+4" = view-pin-to-sheet-4
"LS+5" = view-pin-to-sheet-5
"LS+6" = view-pin-to-sheet-6
"LS+7" = view-pin-to-sheet-7
"LS+8" = view-pin-to-sheet-8
"LS+9" = view-pin-to-sheet-9
"LS+numbersign" = view-pin-to-sheet-alternate
"LS+Period" = view-pin-to-sheet-current
"LS+j" = view-pin-to-sheet-next
"LS+k" = view-pin-to-sheet-prev
"L+q" = view-quit
"L+Tab" = view-cycle-next
"LS+Tab" = view-cycle-prev
"L+Up" = view-move-up
"L+Down" = view-move-down
"L+Left" = view-move-left
"L+Right" = view-move-right
"LA+Up" = view-decrease-size-up
"LAS+Up" = view-increase-size-up
"LA+Down" = view-increase-size-down
"LAS+Down" = view-decrease-size-down
"LA+Left" = view-decrease-size-left
"LAS+Left" = view-increase-size-left
"LA+Right" = view-increase-size-right
"LAS+Right" = view-decrease-size-right
"LS+Up" = view-snap-up
"LS+Down" = view-snap-down
"LS+Left" = view-snap-left
"LS+Right" = view-snap-right
"L+r" = view-reset-geometry
"L+minus" = view-toggle-maximize-vertical
"L+less" = view-toggle-maximize-horizontal
"L+f" = view-toggle-maximize-full
"L5+plus" = view-toggle-floating
"L+i" = view-toggle-invisible
"L5+p" = view-toggle-public
"L+l" = mode-enter-layout
"L+s" = mode-enter-sheet-assign
"L+g" = mode-enter-group-assign
"L+m" = mode-enter-mark-assign
"L+acute" = mode-enter-mark-select
"LS+acute" = mode-enter-mark-switch-select
"LCA+g" = mode-enter-input-grab
"LS+Backspace" = lock
"LCA+q" = quit
"LCA+r" = reload
"L+Return" = action-terminal
"L+d" = action-run
"A+F1" = vt-switch-to-1
"A+F2" = vt-switch-to-2
"A+F3" = vt-switch-to-3
"A+F4" = vt-switch-to-4
"A+F5" = vt-switch-to-5
"A+F6" = vt-switch-to-6
"A+F7" = vt-switch-to-7
"A+F8" = vt-switch-to-8
"A+F9" = vt-switch-to-9
}
mouse {
"L+left" = mode-enter-move
"L+right" = mode-enter-resize
} }
} }
} '';
"hikari/autostart".source =
layouts { "${
# main stack pkgs.writeScriptBin
s = { "hikari-autostart"
scale = { ''
min = 0.5
max = 0.75
}
left = single
right = stack
}
# main queue
q = {
scale = 0.75
top = single
bottom = queue
}
f = full
h = stack
v = queue
g = grid
}
actions {
terminal = "${pkgs.alacritty}/bin/alacritty"
run = "${pkgs.wofi}/bin/wofi --show drun"
}
bindings {
keyboard {
"L+0" = workspace-switch-to-sheet-0
"L+1" = workspace-switch-to-sheet-1
"L+2" = workspace-switch-to-sheet-2
"L+3" = workspace-switch-to-sheet-3
"L+4" = workspace-switch-to-sheet-4
"L+5" = workspace-switch-to-sheet-5
"L+6" = workspace-switch-to-sheet-6
"L+7" = workspace-switch-to-sheet-7
"L+8" = workspace-switch-to-sheet-8
"L+9" = workspace-switch-to-sheet-9
"L+numbersign" = workspace-switch-to-sheet-alternate
"L+Period" = workspace-switch-to-sheet-current
"L+j" = workspace-switch-to-sheet-next
"L+k" = workspace-switch-to-sheet-prev
"L+Comma" = workspace-switch-to-sheet-next-inhabited
"LS+Comma" = workspace-switch-to-sheet-prev-inhabited
"LSC+g" = workspace-show-group
"LSC+i" = workspace-show-invisible
"LSC+Period" = workspace-show-all
"LC+n" = workspace-cycle-next
"LC+p" = workspace-cycle-prev
"LC+i" = sheet-show-invisible
"LC+Period" = sheet-show-all
"LC+g" = sheet-show-group
"LA+r" = layout-reset
"LA+Return" = layout-restack-append
"LAS+Return" = layout-restack-prepend
"L+Home" = layout-cycle-view-first
"L+End" = layout-cycle-view-last
"L+n" = layout-cycle-view-next
"L+p" = layout-cycle-view-prev
"L+x" = layout-exchange-view-next
"LS+x" = layout-exchange-view-prev
"LA+x" = layout-exchange-view-main
"LS+0" = view-pin-to-sheet-0
"LS+1" = view-pin-to-sheet-1
"LS+2" = view-pin-to-sheet-2
"LS+3" = view-pin-to-sheet-3
"LS+4" = view-pin-to-sheet-4
"LS+5" = view-pin-to-sheet-5
"LS+6" = view-pin-to-sheet-6
"LS+7" = view-pin-to-sheet-7
"LS+8" = view-pin-to-sheet-8
"LS+9" = view-pin-to-sheet-9
"LS+numbersign" = view-pin-to-sheet-alternate
"LS+Period" = view-pin-to-sheet-current
"LS+j" = view-pin-to-sheet-next
"LS+k" = view-pin-to-sheet-prev
"L+q" = view-quit
"L+Tab" = view-cycle-next
"LS+Tab" = view-cycle-prev
"L+Up" = view-move-up
"L+Down" = view-move-down
"L+Left" = view-move-left
"L+Right" = view-move-right
"LA+Up" = view-decrease-size-up
"LAS+Up" = view-increase-size-up
"LA+Down" = view-increase-size-down
"LAS+Down" = view-decrease-size-down
"LA+Left" = view-decrease-size-left
"LAS+Left" = view-increase-size-left
"LA+Right" = view-increase-size-right
"LAS+Right" = view-decrease-size-right
"LS+Up" = view-snap-up
"LS+Down" = view-snap-down
"LS+Left" = view-snap-left
"LS+Right" = view-snap-right
"L+r" = view-reset-geometry
"L+minus" = view-toggle-maximize-vertical
"L+less" = view-toggle-maximize-horizontal
"L+f" = view-toggle-maximize-full
"L5+plus" = view-toggle-floating
"L+i" = view-toggle-invisible
"L5+p" = view-toggle-public
"L+l" = mode-enter-layout
"L+s" = mode-enter-sheet-assign
"L+g" = mode-enter-group-assign
"L+m" = mode-enter-mark-assign
"L+acute" = mode-enter-mark-select
"LS+acute" = mode-enter-mark-switch-select
"LCA+g" = mode-enter-input-grab
"LS+Backspace" = lock
"LCA+q" = quit
"LCA+r" = reload
"L+Return" = action-terminal
"L+d" = action-run
"A+F1" = vt-switch-to-1
"A+F2" = vt-switch-to-2
"A+F3" = vt-switch-to-3
"A+F4" = vt-switch-to-4
"A+F5" = vt-switch-to-5
"A+F6" = vt-switch-to-6
"A+F7" = vt-switch-to-7
"A+F8" = vt-switch-to-8
"A+F9" = vt-switch-to-9
}
mouse {
"L+left" = mode-enter-move
"L+right" = mode-enter-resize
}
}
'';
"hikari/autostart".source = "${
pkgs.writeScriptBin "hikari-autostart" ''
#!${pkgs.stdenv.shell} #!${pkgs.stdenv.shell}
${pkgs.waybar}/bin/waybar & ${pkgs.waybar}/bin/waybar &
'' ''

View File

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

View File

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