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,5 +1,12 @@
{ pkgs, lib, budUtils, ... }: { {
bud.cmds = with pkgs; { pkgs,
lib,
budUtils,
...
}:
{
bud.cmds =
with pkgs; {
get = { get = {
writer = budUtils.writeBashWithPaths [nixUnstable git coreutils]; writer = budUtils.writeBashWithPaths [nixUnstable git coreutils];
synopsis = "get [DEST]"; synopsis = "get [DEST]";

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"
];
filterSystems = lib.filterAttrs
(system: _: lib.elem system ciSystems);
recurseIntoAttrsRecursive = lib.mapAttrs (_: v:
if lib.isAttrs v if lib.isAttrs v
then recurseIntoAttrsRecursive (lib.recurseIntoAttrs v) then recurseIntoAttrsRecursive (lib.recurseIntoAttrs v)
else v else v);
); systemOutputs =
lib.filterAttrs
systemOutputs = lib.filterAttrs (name: set: lib.isAttrs set && lib.any (system: set ? ${system} && name != "legacyPackages") ciSystems)
(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",

103
flake.nix
View File

@ -1,86 +1,100 @@
{ {
description = "A highly structured configuration database."; description = "A highly structured configuration database.";
inputs = {
inputs =
{
nixos.url = "github:nixos/nixpkgs/nixos-unstable"; nixos.url = "github:nixos/nixpkgs/nixos-unstable";
digga.url = "github:divnix/digga/main"; digga.url = "github:divnix/digga/main";
digga.inputs.nixpkgs.follows = "nixos"; digga.inputs.nixpkgs.follows = "nixos";
digga.inputs.nixlib.follows = "nixos"; digga.inputs.nixlib.follows = "nixos";
digga.inputs.home-manager.follows = "home"; digga.inputs.home-manager.follows = "home";
home.url = "github:nix-community/home-manager/master"; home.url = "github:nix-community/home-manager/master";
home.inputs.nixpkgs.follows = "nixos"; home.inputs.nixpkgs.follows = "nixos";
naersk.url = "github:nmattia/naersk"; naersk.url = "github:nmattia/naersk";
naersk.inputs.nixpkgs.follows = "nixos"; naersk.inputs.nixpkgs.follows = "nixos";
nixos-hardware.url = "github:nixos/nixos-hardware"; nixos-hardware.url = "github:nixos/nixos-hardware";
rnixLsp = { rnixLsp = {
url = "github:nix-community/rnix-lsp"; url = "github:nix-community/rnix-lsp";
inputs.naersk.follows = "naersk"; inputs.naersk.follows = "naersk";
inputs.nixpkgs.follows = "nixos"; inputs.nixpkgs.follows = "nixos";
inputs.utils.follows = "digga/flake-utils";
}; };
/*helix = { alejandra = {
url = "github:kamadorueda/alejandra";
inputs.nixpkgs.follows = "nixos";
};
/*
helix = {
url = "https://github.com/helix-editor/helix.git"; url = "https://github.com/helix-editor/helix.git";
type = "git"; type = "git";
submodules = true; submodules = true;
inputs.nixpkgs.follows = "nixos"; inputs.nixpkgs.follows = "nixos";
};*/ };
*/
nixosPersistence.url = "github:nix-community/impermanence"; nixosPersistence.url = "github:nix-community/impermanence";
nixpkgsWayland = { nixpkgsWayland = {
url = "github:colemickens/nixpkgs-wayland"; url = "github:colemickens/nixpkgs-wayland";
inputs.nixpkgs.follows = "nixos"; 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: ...
}
@ inputs:
digga.lib.mkFlake 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: { (
_: prev: {
#helix = helix.packages.${prev.system}.helix; #helix = helix.packages.${prev.system}.helix;
#helix-src = prev.helix.src; #helix-src = prev.helix.src;
#rnix-lsp = rnixLsp.packages.${prev.system}.rnix-lsp; #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: { (
_: prev: {
__dontExport = true; __dontExport = true;
lib = prev.lib.extend (_: _: { lib = prev.lib.extend (_: _: { our = self.lib; });
our = self.lib; }
}); )
})
]; ];
nixos = { nixos = {
hostDefaults = { hostDefaults = {
system = "x86_64-linux"; system = "x86_64-linux";
@ -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 =
(digga.lib.rakeLeaves ./profiles)
// {
users = digga.lib.rakeLeaves ./users; users = digga.lib.rakeLeaves ./users;
nixos-hardware = nixos-hardware.nixosModules; nixos-hardware = nixos-hardware.nixosModules;
}; };
suites = with profiles; { suites =
with profiles; {
base = [cachix core users.root]; base = [cachix core users.root];
work = [users.patriot develop]; 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,9 +1,19 @@
{ 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 =
btrfsDiff = pkgs.writeScriptBin "btrfs-diff" '' pkgs.writeScriptBin
"btrfs-diff"
''
#!${pkgs.bash}/bin/bash #!${pkgs.bash}/bin/bash
set -euo pipefail set -euo pipefail
@ -30,13 +40,12 @@ let
sudo umount /mnt sudo umount /mnt
''; '';
in in {
{ imports =
imports = suites.base ++ suites.work ++ [ suites.base
../profiles/network/networkmanager ++ suites.work
(modulesPath + "/installer/scan/not-detected.nix") ++ [../profiles/network/networkmanager (modulesPath + "/installer/scan/not-detected.nix")]
] ++ (with profiles.nixos-hardware; [ common-pc-ssd common-pc common-gpu-amd common-cpu-amd ]); ++ (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;
@ -45,13 +54,14 @@ in
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"]; kernelModules = ["kvm-amd"];
extraModulePackages = []; extraModulePackages = [];
initrd.postDeviceCommands = pkgs.lib.mkBefore '' initrd.postDeviceCommands =
pkgs.lib.mkBefore
''
mkdir -p /mnt mkdir -p /mnt
mount -o subvol=/ ${btrfsPartPath} /mnt mount -o subvol=/ ${btrfsPartPath} /mnt
btrfs subvolume list -o /mnt/root | btrfs subvolume list -o /mnt/root |
@ -66,11 +76,8 @@ in
btrfs subvolume snapshot /mnt/root-blank /mnt/root btrfs subvolume snapshot /mnt/root-blank /mnt/root
umount /mnt umount /mnt
''; '';
kernel.sysctl = { kernel.sysctl = { "fs.inotify.max_user_watches" = 524288; };
"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,36 +151,21 @@ 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"];
@ -191,14 +174,17 @@ in
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,20 +192,22 @@ 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 =
lib.mkOverride
10
''
local all all trust local all all trust
host all all 0.0.0.0/0 md5 host all all 0.0.0.0/0 md5
''; '';
settings = { settings = { listen_addresses = "*"; };
listen_addresses = "*"; initialScript =
}; pkgs.writeText
initialScript = pkgs.writeText "backend-initScript" '' "backend-initScript"
''
CREATE ROLE patriot WITH LOGIN PASSWORD 'patriot' CREATEDB; CREATE ROLE patriot WITH LOGIN PASSWORD 'patriot' CREATEDB;
CREATE DATABASE harmony; CREATE DATABASE harmony;
GRANT ALL PRIVILEGES ON DATABASE harmony TO patriot; GRANT ALL PRIVILEGES ON DATABASE harmony TO patriot;
@ -227,9 +215,8 @@ in
}; };
}; };
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,7 +1,6 @@
{ ... }: { ... }:
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;

View File

@ -1,5 +1,8 @@
{ lib }: { lib }:
lib.makeExtensible (self: { lib.makeExtensible
(
self: {
pkgBinNoDep = pkgs: name: "${pkgs.${name}}/bin/${name}"; pkgBinNoDep = pkgs: name: "${pkgs.${name}}/bin/${name}";
html = import ./html.nix { format = true; }; 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
(n: {
name = n;
value = (f n);
})
names);
evalChildren = children:
if isList children
then concatStrings children
else children;
tag =
name: maybeAttrs:
if isAttrs maybeAttrs if isAttrs maybeAttrs
then (children: "<${name}${evalAttrs maybeAttrs}>${fmt}${evalChildren children}${fmt}</${name}>") then (children: "<${name}${evalAttrs maybeAttrs}>${fmt}${evalChildren children}${fmt}</${name}>")
else tag name {} maybeAttrs; else tag name {} maybeAttrs;
tags = (genAttrs tag ["html" "head" "body" "div" "p" "a"]); tags = (genAttrs tag ["html" "head" "body" "div" "p" "a"]);
in in
tags // { tags
// {
inherit tag; inherit tag;
link = url: tags.a { href = url; }; link = url: tags.a { href = url; };
} }

View File

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

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 =
mkOption
{
type = types.bool; type = types.bool;
default = false; default = false;
description = '' description =
''
Whether to disable spectre and meltdown mitigations in the kernel. Do 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 use this in mission critical deployments, or on any machine you do
not have physical access to. 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 = [
@ -17,9 +16,4 @@ let
]; ];
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,10 +1,16 @@
final: prev: rec { final: prev: rec {
discord-canary-system = prev.callPackage mkDiscord (rec { discord-canary-system =
prev.callPackage
mkDiscord
(
rec {
pname = "discord-canary"; pname = "discord-canary";
version = "0.0.131"; version = "0.0.131";
binaryName = "DiscordCanary"; binaryName = "DiscordCanary";
desktopName = "Discord Canary"; desktopName = "Discord Canary";
src = prev.fetchurl { src =
prev.fetchurl
{
url = "https://dl-canary.discordapp.net/apps/linux/${version}/discord-canary-${version}.tar.gz"; url = "https://dl-canary.discordapp.net/apps/linux/${version}/discord-canary-${version}.tar.gz";
sha256 = "sha256-ZYPdE02Jq79LmvXu7KIJFugJX++Nnj0Og/mBuaP/+SA="; sha256 = "sha256-ZYPdE02Jq79LmvXu7KIJFugJX++Nnj0Og/mBuaP/+SA=";
}; };
@ -16,68 +22,70 @@ final: prev: rec {
"--enable-zero-copy" "--enable-zero-copy"
"--disable-gpu-driver-bug-workarounds" "--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
rec {
inherit pname version src; inherit pname version src;
nativeBuildInputs = [ nativeBuildInputs = [
nodePackages.asar nodePackages.asar
alsaLib alsaLib
@ -94,10 +102,10 @@ final: prev: rec {
nss nss
wrapGAppsHook wrapGAppsHook
]; ];
dontWrapGApps = true; dontWrapGApps = true;
libPath =
libPath = lib.makeLibraryPath [ lib.makeLibraryPath
[
libcxx libcxx
systemd systemd
libpulseaudio libpulseaudio
@ -140,16 +148,23 @@ final: prev: rec {
libGL libGL
pipewire pipewire
]; ];
flags =
flags = (lib.optionals isWayland [ (
lib.optionals
isWayland
[
"--flag-switches-begin" "--flag-switches-begin"
"--enable-features=UseOzonePlatform,WebRTCPipeWireCapturer${lib.optionalString enableVulkan ",Vulkan"}" "--enable-features=UseOzonePlatform,WebRTCPipeWireCapturer${
lib.optionalString enableVulkan ",Vulkan"
}"
"--flag-switches-end" "--flag-switches-end"
"--ozone-platform=wayland" "--ozone-platform=wayland"
"--enable-webrtc-pipewire-capturer" "--enable-webrtc-pipewire-capturer"
]) ++ extraOptions; ]
)
installPhase = '' ++ extraOptions;
installPhase =
''
mkdir -p $out/{bin,usr/lib/${pname},share/pixmaps} mkdir -p $out/{bin,usr/lib/${pname},share/pixmaps}
ln -s discord.png $out/share/pixmaps/${pname}.png ln -s discord.png $out/share/pixmaps/${pname}.png
ln -s "${desktopItem}/share/applications" $out/share/ ln -s "${desktopItem}/share/applications" $out/share/
@ -175,8 +190,9 @@ final: prev: rec {
--prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \ --prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \
--prefix LD_LIBRARY_PATH : ${libPath} --prefix LD_LIBRARY_PATH : ${libPath}
''; '';
desktopItem =
desktopItem = makeDesktopItem { makeDesktopItem
{
name = pname; name = pname;
exec = pname; exec = pname;
icon = pname; icon = pname;
@ -185,8 +201,8 @@ final: prev: rec {
categories = "Network;InstantMessaging;"; categories = "Network;InstantMessaging;";
mimeType = "x-scheme-handler/discord"; mimeType = "x-scheme-handler/discord";
}; };
meta =
meta = with lib; { with lib; {
description = "All-in-one cross-platform voice and text chat for gamers"; description = "All-in-one cross-platform voice and text chat for gamers";
homepage = "https://discordapp.com/"; homepage = "https://discordapp.com/";
downloadPage = "https://discordapp.com/download"; downloadPage = "https://discordapp.com/download";

View File

@ -1,13 +1,19 @@
final: prev: { final: prev: {
discord-canary = prev.discord-canary.overrideAttrs (old: discord-canary =
let binaryName = "DiscordCanary"; in prev.discord-canary.overrideAttrs
rec { (
old: let
binaryName = "DiscordCanary";
in rec {
version = "0.0.123"; version = "0.0.123";
src = prev.fetchurl { src =
prev.fetchurl
{
url = "https://dl-canary.discordapp.net/apps/linux/${version}/discord-canary-${version}.tar.gz"; url = "https://dl-canary.discordapp.net/apps/linux/${version}/discord-canary-${version}.tar.gz";
sha256 = "0bijwfsd9s4awqkgxd9c2cxh7y5r06vix98qjp0dkv63r6jig8ch"; sha256 = "0bijwfsd9s4awqkgxd9c2cxh7y5r06vix98qjp0dkv63r6jig8ch";
}; };
installPhase = '' installPhase =
''
mkdir -p $out/{bin,opt/${binaryName},share/pixmaps} mkdir -p $out/{bin,opt/${binaryName},share/pixmaps}
mv * $out/opt/${binaryName} mv * $out/opt/${binaryName}
chmod +x $out/opt/${binaryName}/${binaryName} chmod +x $out/opt/${binaryName}/${binaryName}
@ -21,5 +27,6 @@ final: prev: {
ln -s $out/opt/${binaryName}/discord.png $out/share/pixmaps/${old.pname}.png ln -s $out/opt/${binaryName}/discord.png $out/share/pixmaps/${old.pname}.png
ln -s "${old.desktopItem}/share/applications" $out/share/ 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,23 +1,24 @@
final: prev: { final: prev: {
phantomstyle = prev.stdenv.mkDerivation { phantomstyle =
prev.stdenv.mkDerivation
{
pname = "phantomstyle"; pname = "phantomstyle";
version = "6e9580b"; version = "6e9580b";
src =
src = builtins.fetchGit { builtins.fetchGit
{
url = "https://github.com/randrew/phantomstyle.git"; url = "https://github.com/randrew/phantomstyle.git";
rev = "6e9580b72e372b5acecd616434eaf441bf73bcf4"; rev = "6e9580b72e372b5acecd616434eaf441bf73bcf4";
}; };
dontWrapQtApps = true; dontWrapQtApps = true;
buildInputs = [prev.libsForQt5.qt5.qtbase]; buildInputs = [prev.libsForQt5.qt5.qtbase];
buildPhase =
buildPhase = '' ''
cd src/styleplugin cd src/styleplugin
qmake && make qmake && make
''; '';
installPhase =
installPhase = '' ''
mkdir -p $out/$qtPluginPrefix/styles mkdir -p $out/$qtPluginPrefix/styles
mv libphantomstyleplugin.so $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
"vscode-wayland"
''
#!${pkgs.stdenv.shell} #!${pkgs.stdenv.shell}
${pkgs.vscode}/bin/code ${lib.concatStringsSep " " flags} ${pkgs.vscode}/bin/code ${lib.concatStringsSep " " flags}
''; '';
in in {
{
vscodeWayland = vscodeWayland =
let let
pname = "vscode"; pname = "vscode";
desktop = pkgs.makeDesktopItem { desktop =
pkgs.makeDesktopItem
{
name = pname; name = pname;
exec = pname; exec = pname;
icon = "vscode"; icon = "vscode";
desktopName = "VSCode Wayland"; desktopName = "VSCode Wayland";
}; };
in in
lib.hiPrio (pkgs.stdenv.mkDerivation { lib.hiPrio
(
pkgs.stdenv.mkDerivation
{
inherit pname; inherit pname;
version = pkgs.vscode.version; version = pkgs.vscode.version;
nativeBuildInputs = [pkgs.makeWrapper]; nativeBuildInputs = [pkgs.makeWrapper];
phases = [ "installPhase" /*"fixupPhase"*/ ]; phases = [
installPhase = '' "installPhase"
/*
"fixupPhase"
*/
];
installPhase =
''
mkdir -p $out/bin mkdir -p $out/bin
install -m755 ${vscodeWayland}/bin/${pname}-wayland $out/bin/${pname} install -m755 ${vscodeWayland}/bin/${pname}-wayland $out/bin/${pname}
cp -r ${desktop}/share $out/share cp -r ${desktop}/share $out/share
''; '';
/*fixupPhase = '' /*
fixupPhase = ''
wrapProgram $out/bin/${pname} \ wrapProgram $out/bin/${pname} \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath (with pkgs; [ vulkan-loader vulkan-extension-layer libGL ])} --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath (with pkgs; [ vulkan-loader vulkan-extension-layer libGL ])}
'';*/ '';
}); */
}
);
} }

View File

@ -1,10 +1,15 @@
# 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 =
fetchgit
{
url = "https://github.com/mlvzk/manix"; url = "https://github.com/mlvzk/manix";
rev = "d08e7ca185445b929f097f8bfb1243a8ef3e10e4"; rev = "d08e7ca185445b929f097f8bfb1243a8ef3e10e4";
fetchSubmodules = false; fetchSubmodules = false;

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,23 +1,26 @@
{ 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 =
with pkgs; [
binutils binutils
coreutils coreutils
curl curl
@ -58,41 +61,41 @@ in
du-dust du-dust
mosh mosh
( (
pkgs.runCommand "0x0.sh" { } '' pkgs.runCommand
"0x0.sh"
{}
''
mkdir -p $out/bin mkdir -p $out/bin
cp ${pkgs.fetchurl { cp ${
pkgs.fetchurl
{
url = "https://raw.githubusercontent.com/Calinou/0x0/master/bin/0x0"; url = "https://raw.githubusercontent.com/Calinou/0x0/master/bin/0x0";
sha256 = "sha256-Fad+AKBuA49qtRQfnroqjaNWeuRaCekXZG9sS9JVeaM="; sha256 = "sha256-Fad+AKBuA49qtRQfnroqjaNWeuRaCekXZG9sS9JVeaM=";
}} $out/bin/0x0 }
} $out/bin/0x0
chmod +x $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; })
(lib.filterAttrs (_: v: v ? outputs) inputs))
["bud"]; ["bud"];
in 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" ];
extraOptions = ''
min-free = 536870912 min-free = 536870912
keep-outputs = true keep-outputs = true
keep-derivations = true keep-derivations = true
fallback = 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 = { /*
services.openssh = {
enable = true; enable = true;
openFirewall = lib.mkDefault false; openFirewall = lib.mkDefault false;
};*/ };
*/
services.earlyoom.enable = true; services.earlyoom.enable = true;
} }

View File

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

View File

@ -1,6 +1,9 @@
{ pkgs, ... }: { {
pkgs,
...
}:
{
imports = [./helix.nix]; imports = [./helix.nix];
environment.systemPackages = with pkgs; [alejandra];
environment.systemPackages = with pkgs; [ nixpkgs-fmt ]; environment.shellAliases = { nixf-all = "alejandra **/**.nix"; };
environment.shellAliases = { nixf-all = "nixpkgs-fmt **/**.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,9 +1,9 @@
{ {
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 noarp
nodelay nodelay
''; '';

View File

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

View File

@ -1,4 +1,5 @@
{ ... }: { { ... }:
{
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,
inputs,
...
}:
{
modules =
with inputs; [
#bud.devshellModules.bud #bud.devshellModules.bud
]; ];
exportedModules = [ exportedModules = [./devos.nix];
./devos.nix
];
} }

View File

@ -1,22 +1,24 @@
{ 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 =
pkgs.lib.mkForce
(
pkgs.lib.noDepEntry
''
# PATH is devshell's exorbitant privilige: # PATH is devshell's exorbitant privilige:
# fence against its pollution # fence against its pollution
_PATH=''${PATH} _PATH=''${PATH}
@ -28,34 +30,27 @@ in
# Exert exorbitant privilige and leave no trace # Exert exorbitant privilige and leave no trace
export PATH=''${_PATH} export PATH=''${_PATH}
unset _PATH unset _PATH
''); ''
);
packages = with pkgs; [ packages = with pkgs; [git-crypt];
git-crypt commands =
]; with pkgs;
[
commands = with pkgs; [
(devos nixUnstable) (devos nixUnstable)
#(devos agenix) #(devos agenix)
/*{ /*
{
category = "devos"; category = "devos";
name = pkgs.nvfetcher-bin.pname; name = pkgs.nvfetcher-bin.pname;
help = pkgs.nvfetcher-bin.meta.description; help = pkgs.nvfetcher-bin.meta.description;
command = "cd $PRJ_ROOT/pkgs; ${pkgs.nvfetcher-bin}/bin/nvfetcher -c ./sources.toml $@"; command = "cd $PRJ_ROOT/pkgs; ${pkgs.nvfetcher-bin}/bin/nvfetcher -c ./sources.toml $@";
}*/ }
(linter nixpkgs-fmt) */
(linter editorconfig-checker) #(linter nixpkgs-fmt)
#(linter editorconfig-checker)
# (docs python3Packages.grip) too many deps # (docs python3Packages.grip) too many deps
# (docs mdbook) # (docs mdbook)
] ]
++ lib.optional (pkgs ? deploy-rs) (devos deploy-rs.deploy-rs)
++ lib.optional ++ lib.optional (system != "i686-linux") (devos cachix);
(pkgs ? deploy-rs)
(devos deploy-rs.deploy-rs)
++ lib.optional
(system != "i686-linux")
(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

@ -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;
@ -49,10 +52,12 @@ in
sudo.extraRules = [ sudo.extraRules = [
{ {
users = ["patriot"]; users = ["patriot"];
commands = [{ commands = [
{
command = "${pkgs.profile-sync-daemon}/bin/psd-overlay-helper"; command = "${pkgs.profile-sync-daemon}/bin/psd-overlay-helper";
options = ["SETENV" "NOPASSWD"]; 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,16 +221,18 @@ in
border = "#${acColor2}"; border = "#${acColor2}";
text = "#${acColor2}"; text = "#${acColor2}";
}; };
addIndSway = x: { addIndSway =
x: {
background = x.background; background = x.background;
border = x.border; border = x.border;
childBorder = x.border; childBorder = x.border;
text = x.text; text = x.text;
indicator = "#111111"; # don't care indicator = "#111111";
# don't care
}; };
fonts = [fontComb]; fonts = [fontComb];
extraEnv =
extraEnv = '' ''
export SDL_VIDEODRIVER=wayland export SDL_VIDEODRIVER=wayland
# needs qt5.qtwayland in systemPackages # needs qt5.qtwayland in systemPackages
export QT_QPA_PLATFORM=wayland export QT_QPA_PLATFORM=wayland
@ -246,12 +243,11 @@ in
#export QT_QPA_PLATFORMTHEME=qt5ct #export QT_QPA_PLATFORMTHEME=qt5ct
#export QT_PLATFORM_PLUGIN=qt5ct #export QT_PLATFORM_PLUGIN=qt5ct
''; '';
in in {
{
imports = suites.base; imports = suites.base;
# needs to be fixed to use nix profile??? # needs to be fixed to use nix profile???
/*gtk = { /*
gtk = {
enable = false; enable = false;
font = { font = {
package = pkgs.dejavu_fonts; package = pkgs.dejavu_fonts;
@ -273,31 +269,25 @@ in
package = pkgs.adwaita-qt; package = pkgs.adwaita-qt;
name = "adwaita-dark"; 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,37 +296,55 @@ in
ffmpeg ffmpeg
mupdf mupdf
transmission-qt transmission-qt
(lib.hiPrio (lutris.overrideAttrs (old: { (
profile = '' lib.hiPrio
(
lutris.overrideAttrs
(
old: {
profile =
''
${old.profile or ""} ${old.profile or ""}
unset VK_ICD_FILENAMES unset VK_ICD_FILENAMES
export VK_ICD_FILENAMES=${nixosConfig.environment.variables.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 { (
lib.hiPrio
(
steam.override
{
extraLibraries = pkgs: [pkgs.pipewire]; extraLibraries = pkgs: [pkgs.pipewire];
extraProfile = '' extraProfile =
''
unset VK_ICD_FILENAMES unset VK_ICD_FILENAMES
export VK_ICD_FILENAMES=${nixosConfig.environment.variables.VK_ICD_FILENAMES}''; export VK_ICD_FILENAMES=${nixosConfig.environment.variables.VK_ICD_FILENAMES}'';
})) }
/*(multimc.overrideAttrs (old: { )
)
/*
(multimc.overrideAttrs (old: {
src = builtins.fetchGit { url = "https://github.com/AfoninZ/MultiMC5-Cracked.git"; ref = "develop"; rev = "9069e9c9d0b7951c310fdcc8bdc70ebc422a7634"; submodules = true; }; 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 = {
@ -344,9 +352,7 @@ in
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,26 +375,27 @@ 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}+q" = "kill";
"${mod}+Shift+e" = "exit"; "${mod}+Shift+e" = "exit";
"${mod}+Shift+r" = "reload"; "${mod}+Shift+r" = "reload";
# Screenshot and copy it to clipboard # Screenshot and copy it to clipboard
"Mod1+s" = '' "Mod1+s" =
''
exec export SFILE="${shotFile}.png" && ${grim} "$SFILE" && ${cat} "$SFILE" | ${wl-copy} -t image/png exec export SFILE="${shotFile}.png" && ${grim} "$SFILE" && ${cat} "$SFILE" | ${wl-copy} -t image/png
''; '';
# Save selected area as a picture and copy it to clipboard # Save selected area as a picture and copy it to clipboard
"Mod1+Shift+s" = '' "Mod1+Shift+s" =
''
exec export SFILE="${shotFile}.png" && ${grim} -g "$(${slurp})" "$SFILE" && ${cat} "$SFILE" | ${wl-copy} -t image/png exec export SFILE="${shotFile}.png" && ${grim} -g "$(${slurp})" "$SFILE" && ${cat} "$SFILE" | ${wl-copy} -t image/png
''; '';
# Record screen # Record screen
"Mod1+r" = ''exec ${wf-recorder} -f "${shotFile}.mp4"''; "Mod1+r" = ''exec ${wf-recorder} -f "${shotFile}.mp4"'';
# Record an area # Record an area
"Mod1+Shift+r" = "Mod1+Shift+r" = ''exec ${wf-recorder} -g "$(${slurp})" -f "${shotFile}.mp4"'';
''exec ${wf-recorder} -g "$(${slurp})" -f "${shotFile}.mp4"'';
# Stop recording # Stop recording
"Mod1+c" = "exec pkill -INT wf-recorder"; "Mod1+c" = "exec pkill -INT wf-recorder";
"XF86AudioRaiseVolume" = "exec ${pactl} set-sink-volume 0 +5%"; "XF86AudioRaiseVolume" = "exec ${pactl} set-sink-volume 0 +5%";
@ -405,15 +412,10 @@ in
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;
@ -437,7 +439,8 @@ in
escapeTime = 0; escapeTime = 0;
keyMode = "vi"; keyMode = "vi";
shortcut = "a"; shortcut = "a";
extraConfig = '' extraConfig =
''
set -g default-terminal "alacritty" set -g default-terminal "alacritty"
set -ga terminal-overrides ",alacritty:Tc" set -ga terminal-overrides ",alacritty:Tc"
set -g status off set -g status off
@ -447,14 +450,22 @@ in
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 =
d: ''
config.set('content.javascript.enabled', True, 'https://*.${d}') config.set('content.javascript.enabled', True, 'https://*.${d}')
''; '';
in in ''
''
${lib.concatStrings (map enableJsForDomain domains)} ${lib.concatStrings (map enableJsForDomain domains)}
''; '';
}; };
@ -520,33 +531,38 @@ 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 =
pkgs.fetchFromGitHub
{
owner = "jimhester"; owner = "jimhester";
repo = "per-directory-history"; repo = "per-directory-history";
rev = "d2e291dd6434e340d9be0e15e1f5b94f32771c06"; rev = "d2e291dd6434e340d9be0e15e1f5b94f32771c06";
hash = "sha256-VHRgrVCqzILqOes8VXGjSgLek38BFs9eijmp0JHtD5Q="; 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 if [ "$(${pkgs.coreutils}/bin/tty)" = "/dev/tty1" ]; then
exec sway exec sway
fi fi
'';*/ '';
initExtra = '' */
initExtra =
''
export TERM=alacritty export TERM=alacritty
export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
@ -564,8 +580,11 @@ in
eval "$(zoxide init zsh)" eval "$(zoxide init zsh)"
''; '';
shellAliases = nixosConfig.environment.shellAliases // { shellAliases =
harmony-ssh = '' nixosConfig.environment.shellAliases
// {
harmony-ssh =
''
${pkgs.mosh}/bin/mosh root@chat.harmonyapp.io ${pkgs.mosh}/bin/mosh root@chat.harmonyapp.io
''; '';
}; };
@ -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,15 +606,25 @@ 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 [ (
pkgs.vscode-utils.extensionsFromVscodeMarketplace
[
# Rust # Rust
(mkExt "rust-analyzer" "0.2.760" "matklad" "sha256-M+eFqIFwiKkiwqFRwkX5h6mc/W+NBqkXcNUdTewwkCI=") (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=") (mkExt "even-better-toml" "0.14.2" "tamasfe" "sha256-lE2t+KUfClD/xjpvexTJlEr7Kufo+22DUM9Ju4Tisp0=")
(mkExt "crates" "0.5.9" "serayuzgur" "sha256-YHIbnl2R7lqwJHi8qUQImClx9MWm+5Pc12vYw7e/RlA=") (mkExt "crates" "0.5.9" "serayuzgur" "sha256-YHIbnl2R7lqwJHi8qUQImClx9MWm+5Pc12vYw7e/RlA=")
# Nix # Nix
(mkExt "nix-env-selector" "1.0.7" "arrterian" "sha256-DnaIXJ27bcpOrIp1hm7DcrlIzGSjo4RTJ9fD72ukKlc=") (
mkExt "nix-env-selector" "1.0.7" "arrterian" "sha256-DnaIXJ27bcpOrIp1hm7DcrlIzGSjo4RTJ9fD72ukKlc="
)
# Go # Go
(mkExt "Go" "0.25.1" "golang" "sha256-ZDUWN9lzDnR77W7xcMFQaaFl/6Lf/x1jgaBkwZPqGGw=") (mkExt "Go" "0.25.1" "golang" "sha256-ZDUWN9lzDnR77W7xcMFQaaFl/6Lf/x1jgaBkwZPqGGw=")
# Flutter and dart # Flutter and dart
@ -607,20 +635,39 @@ in
(mkExt "vscode-buf" "0.3.1" "bufbuild" "sha256-KjU6WlDxYPPJjh45mCq6Kczi6odYwnLaGj4RHe3fc2w=") (mkExt "vscode-buf" "0.3.1" "bufbuild" "sha256-KjU6WlDxYPPJjh45mCq6Kczi6odYwnLaGj4RHe3fc2w=")
# git # git
(mkExt "gitlens" "11.6.0" "eamodio" "sha256-JxCNE/IL/v94xWmhebsRZo1Gw+nSSpDgZ41ZGongGVI=") (mkExt "gitlens" "11.6.0" "eamodio" "sha256-JxCNE/IL/v94xWmhebsRZo1Gw+nSSpDgZ41ZGongGVI=")
(mkExt "vscode-commitizen" "0.14.1" "KnisterPeter" "sha256-yw8XKGL7Ul9wV+C0yL1LFJCE3+E8u/sR9s3TjkGJPZM=") (
mkExt
"vscode-commitizen"
"0.14.1"
"KnisterPeter"
"sha256-yw8XKGL7Ul9wV+C0yL1LFJCE3+E8u/sR9s3TjkGJPZM="
)
# Customization # Customization
# (mkExt "dance" "0.3.2" "gregoire" "sha256-+g8EXeCkPOPvZ60JoXkGTeSXYWrXmKrcbUaEfDppdgA=") # (mkExt "dance" "0.3.2" "gregoire" "sha256-+g8EXeCkPOPvZ60JoXkGTeSXYWrXmKrcbUaEfDppdgA=")
(mkExt "material-icon-theme" "4.6.0" "PKief" "sha256-i+3lrw3mDqK2vTMDhJYTACW5JleA+lN1XAC2imgQLUo=") (mkExt "material-icon-theme" "4.6.0" "PKief" "sha256-i+3lrw3mDqK2vTMDhJYTACW5JleA+lN1XAC2imgQLUo=")
(mkExt "github-vscode-theme" "4.1.1" "GitHub" "sha256-yLySHOx6pe7w2cyi95pQlKkn/o4VMCTkrTYHu8ASn5M=") (
mkExt "github-vscode-theme" "4.1.1" "GitHub" "sha256-yLySHOx6pe7w2cyi95pQlKkn/o4VMCTkrTYHu8ASn5M="
)
(mkExt "koka" "0.0.1" "maelvalais" "sha256-ty8Mql19HgUWForggeZuHQpzTbmmB/eBFHqof5ZMKr0=") (mkExt "koka" "0.0.1" "maelvalais" "sha256-ty8Mql19HgUWForggeZuHQpzTbmmB/eBFHqof5ZMKr0=")
(mkExt "vscode-rhai" "0.6.3" "rhaiscript" "sha256-gEdpM/TkkiZ50bG9qDU6BH04AJLRDcHLquniRs6m0mg=") (mkExt "vscode-rhai" "0.6.3" "rhaiscript" "sha256-gEdpM/TkkiZ50bG9qDU6BH04AJLRDcHLquniRs6m0mg=")
(mkExt "copilot" "1.2.1991" "GitHub" "sha256-pGb5xfjuy+g646doZEuKhQalkOte5dH+I+1op+vZY48=") (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 ]); ]
)
++ (
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,16 +681,13 @@ 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"];
@ -653,11 +697,11 @@ in
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}]" } "attribute" = { fg = "#${colorScheme.bright.yellow}]" }
"comment" = { fg = "#${colorScheme.normal.gray}", modifiers = ['italic'] } "comment" = { fg = "#${colorScheme.normal.gray}", modifiers = ['italic'] }
"constant" = { fg = "#${colorScheme.normal.blue}" } "constant" = { fg = "#${colorScheme.normal.blue}" }
@ -700,27 +744,37 @@ in
"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" theme = "mytheme"
[editor] [editor]
line-number = "relative" line-number = "relative"
[lsp] [lsp]
display-messages = true display-messages = true
''; '';
"helix/languages.toml".text = '' "helix/languages.toml".text =
''
[[language]] [[language]]
name = "nix" name = "nix"
language-server = { command = "${pkgBin "rnix-lsp"}" } 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;
in
builtins.toJSON
{
layer = "top"; layer = "top";
position = "top"; position = "top";
modules-left = if swayEnabled then [ "sway/workspaces" ] else [ ]; modules-left =
modules-center = if swayEnabled then [ "sway/window" ] else [ ]; if swayEnabled
modules-right = then ["sway/workspaces"]
[ "pulseaudio" "cpu" "memory" "temperature" "clock" "tray" ]; else [];
modules-center =
if swayEnabled
then ["sway/window"]
else [];
modules-right = ["pulseaudio" "cpu" "memory" "temperature" "clock" "tray"];
tray = { spacing = 8; }; tray = { spacing = 8; };
cpu = { format = "/cpu {usage}/"; }; cpu = { format = "/cpu {usage}/"; };
memory = { format = "/mem {}/"; }; memory = { format = "/mem {}/"; };
@ -740,11 +794,11 @@ in
"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}; color: #${color};
${makeBorder 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,11 +1,16 @@
{ fontComb ? "Iosevka 10", config, pkgs, ... }: {
fontComb ? "Iosevka 10",
config,
pkgs,
...
}:
{ {
home.packages = with pkgs; [hikari xwayland]; home.packages = with pkgs; [hikari xwayland];
xdg = { xdg = {
enable = true; enable = true;
configFile = { configFile = {
"hikari/hikari.conf".text = '' "hikari/hikari.conf".text =
''
ui { ui {
border = 1 border = 1
gap = 0 gap = 0
@ -190,8 +195,11 @@
} }
} }
''; '';
"hikari/autostart".source = "${ "hikari/autostart".source =
pkgs.writeScriptBin "hikari-autostart" '' "${
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]; }