Compare commits
29 Commits
b9ea792ddc
...
23.05
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b72adab7f | ||
|
|
556a31b334 | ||
|
|
8fa457dc8d | ||
|
|
760228bcc6 | ||
|
|
7f333af4b5 | ||
|
|
764a209200 | ||
|
|
3b70b6c977 | ||
|
|
09f7f00394 | ||
|
|
85dcafb4e0 | ||
|
|
c56fcae38c | ||
|
|
14711673b7 | ||
|
|
1ea1e189bb | ||
|
|
060ab92af6 | ||
|
|
7fe0dc8d53 | ||
|
|
172ef4ec81 | ||
|
|
b1ce7ce98f | ||
|
|
abec0c9f38 | ||
|
|
90410802c3 | ||
|
|
2bf5d3c165 | ||
|
|
fd22fa23b7 | ||
|
|
b94a54ec98 | ||
|
|
6f9cddb513 | ||
|
|
30b4614657 | ||
|
|
abf29baf20 | ||
|
|
8c221759c9 | ||
|
|
cad1567687 | ||
|
|
a8649e9b2f | ||
|
|
aca058dbae | ||
|
|
b95ed726eb |
272
flake.lock
generated
272
flake.lock
generated
@@ -1,38 +1,5 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"all-cabal-json": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1665552503,
|
|
||||||
"narHash": "sha256-r14RmRSwzv5c+bWKUDaze6pXM7nOsiz1H8nvFHJvufc=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "all-cabal-json",
|
|
||||||
"rev": "d7c0434eebffb305071404edcf9d5cd99703878e",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"ref": "hackage",
|
|
||||||
"repo": "all-cabal-json",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"crane": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1661875961,
|
|
||||||
"narHash": "sha256-f1h/2c6Teeu1ofAHWzrS8TwBPcnN+EEu+z1sRVmMQTk=",
|
|
||||||
"owner": "ipetkov",
|
|
||||||
"repo": "crane",
|
|
||||||
"rev": "d9f394e4e20e97c2a60c3ad82c2b6ef99be19e24",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "ipetkov",
|
|
||||||
"repo": "crane",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"dan": {
|
"dan": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -42,91 +9,15 @@
|
|||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1656687988,
|
"lastModified": 1656687988,
|
||||||
"narHash": "sha256-2ywoy3wUvFAyxDTw7VPlz5TGh9mk/um2AWOjhJqJxNQ=",
|
"narHash": "sha256-2ywoy3wUvFAyxDTw7VPlz5TGh9mk/um2AWOjhJqJxNQ=",
|
||||||
"ref": "master",
|
"ref": "refs/heads/master",
|
||||||
"rev": "7e85f62e40cd585ce81fa1f3debd5385bb0cad03",
|
"rev": "7e85f62e40cd585ce81fa1f3debd5385bb0cad03",
|
||||||
"revCount": 160,
|
"revCount": 160,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git2.dodsorf.as/Dandellion/NUR.git"
|
"url": "https://git.dodsorf.as/Dandellion/NUR.git"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git2.dodsorf.as/Dandellion/NUR.git"
|
"url": "https://git.dodsorf.as/Dandellion/NUR.git"
|
||||||
}
|
|
||||||
},
|
|
||||||
"devshell": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1667210711,
|
|
||||||
"narHash": "sha256-IoErjXZAkzYWHEpQqwu/DeRNJGFdR7X2OGbkhMqMrpw=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "devshell",
|
|
||||||
"rev": "96a9dd12b8a447840cc246e17a47b81a4268bba7",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "devshell",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"dream2nix": {
|
|
||||||
"inputs": {
|
|
||||||
"alejandra": [
|
|
||||||
"helix",
|
|
||||||
"nci",
|
|
||||||
"nixpkgs"
|
|
||||||
],
|
|
||||||
"all-cabal-json": "all-cabal-json",
|
|
||||||
"crane": "crane",
|
|
||||||
"devshell": [
|
|
||||||
"helix",
|
|
||||||
"nci",
|
|
||||||
"devshell"
|
|
||||||
],
|
|
||||||
"flake-utils-pre-commit": [
|
|
||||||
"helix",
|
|
||||||
"nci",
|
|
||||||
"nixpkgs"
|
|
||||||
],
|
|
||||||
"ghc-utils": "ghc-utils",
|
|
||||||
"gomod2nix": [
|
|
||||||
"helix",
|
|
||||||
"nci",
|
|
||||||
"nixpkgs"
|
|
||||||
],
|
|
||||||
"mach-nix": [
|
|
||||||
"helix",
|
|
||||||
"nci",
|
|
||||||
"nixpkgs"
|
|
||||||
],
|
|
||||||
"nixpkgs": [
|
|
||||||
"helix",
|
|
||||||
"nci",
|
|
||||||
"nixpkgs"
|
|
||||||
],
|
|
||||||
"poetry2nix": [
|
|
||||||
"helix",
|
|
||||||
"nci",
|
|
||||||
"nixpkgs"
|
|
||||||
],
|
|
||||||
"pre-commit-hooks": [
|
|
||||||
"helix",
|
|
||||||
"nci",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1667429039,
|
|
||||||
"narHash": "sha256-Lu6da25JioHzerkLHAHSO9suCQFzJ/XBjkcGCIbasLM=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "dream2nix",
|
|
||||||
"rev": "5252794e58eedb02d607fa3187ffead7becc81b0",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "dream2nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
@@ -144,120 +35,40 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils_2": {
|
"home-manager": {
|
||||||
"locked": {
|
|
||||||
"lastModified": 1659877975,
|
|
||||||
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ghc-utils": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1662774800,
|
|
||||||
"narHash": "sha256-1Rd2eohGUw/s1tfvkepeYpg8kCEXiIot0RijapUjAkE=",
|
|
||||||
"ref": "refs/heads/master",
|
|
||||||
"rev": "bb3a2d3dc52ff0253fb9c2812bd7aa2da03e0fea",
|
|
||||||
"revCount": 1072,
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://gitlab.haskell.org/bgamari/ghc-utils"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://gitlab.haskell.org/bgamari/ghc-utils"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"helix": {
|
|
||||||
"inputs": {
|
|
||||||
"nci": "nci",
|
|
||||||
"nixpkgs": [
|
|
||||||
"unstable"
|
|
||||||
],
|
|
||||||
"rust-overlay": "rust-overlay"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1668522840,
|
|
||||||
"narHash": "sha256-lM2yg9+wDwBupmtgkARd3yx3Q6viDdbPIeTstL+CyFs=",
|
|
||||||
"owner": "helix-editor",
|
|
||||||
"repo": "helix",
|
|
||||||
"rev": "df6d04425d130f385c4314ed944d5a27963ae9a3",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "helix-editor",
|
|
||||||
"repo": "helix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"home-manager-2205": {
|
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixos-2205"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1667907331,
|
|
||||||
"narHash": "sha256-bHkAwkYlBjkupPUFcQjimNS8gxWSWjOTevEuwdnp5m0=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "home-manager",
|
|
||||||
"rev": "6639e3a837fc5deb6f99554072789724997bc8e5",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"ref": "release-22.05",
|
|
||||||
"repo": "home-manager",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nci": {
|
|
||||||
"inputs": {
|
|
||||||
"devshell": "devshell",
|
|
||||||
"dream2nix": "dream2nix",
|
|
||||||
"nixpkgs": [
|
|
||||||
"helix",
|
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
],
|
|
||||||
"rust-overlay": [
|
|
||||||
"helix",
|
|
||||||
"rust-overlay"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1667542401,
|
"lastModified": 1695108154,
|
||||||
"narHash": "sha256-mdWjP5tjSf8n6FAtpSgL23kX4+eWBwLrSYo9iY3mA8Q=",
|
"narHash": "sha256-gSg7UTVtls2yO9lKtP0yb66XBHT1Fx5qZSZbGMpSn2c=",
|
||||||
"owner": "yusdacra",
|
"owner": "nix-community",
|
||||||
"repo": "nix-cargo-integration",
|
"repo": "home-manager",
|
||||||
"rev": "cd5e5cbd81c80dc219455dd3b1e0ddb55fae51ec",
|
"rev": "07682fff75d41f18327a871088d20af2710d4744",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "yusdacra",
|
"owner": "nix-community",
|
||||||
"repo": "nix-cargo-integration",
|
"ref": "release-23.05",
|
||||||
|
"repo": "home-manager",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixgl": {
|
"nixgl": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils_2",
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixos-2205"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1661367362,
|
"lastModified": 1685908677,
|
||||||
"narHash": "sha256-Qc8MXcV+YCPREu8kk6oggk23ZBKLqeQRAIsLbHEviPE=",
|
"narHash": "sha256-E4zUPEUFyVWjVm45zICaHRpfGepfkE9Z2OECV9HXfA4=",
|
||||||
"owner": "guibou",
|
"owner": "guibou",
|
||||||
"repo": "nixGL",
|
"repo": "nixGL",
|
||||||
"rev": "7165ffbccbd2cf4379b6cd6d2edd1620a427e5ae",
|
"rev": "489d6b095ab9d289fe11af0219a9ff00fe87c7c5",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -266,29 +77,29 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixos-2205": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1668459637,
|
"lastModified": 1698942558,
|
||||||
"narHash": "sha256-HqnWCKujmtu8v0CjzOT0sr7m2AR7+vpbZJOp1R0rodY=",
|
"narHash": "sha256-/UmnB+mEd6Eg3mJBrAgqRcyZX//RSjHphcCO7Ig9Bpk=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "16f4e04658c2ab10114545af2f39db17d51bd1bd",
|
"rev": "621f51253edffa1d6f08d5fce4f08614c852d17e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"ref": "nixos-22.05",
|
"ref": "nixos-23.05",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nur": {
|
"nur": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1668524723,
|
"lastModified": 1699131694,
|
||||||
"narHash": "sha256-JIJ0MtvY23I/6aIsqi8CG67XWZ/34WtDcgFXxgSTvNU=",
|
"narHash": "sha256-dKWORPD0ODREKihqCZqEqc1zJ3wACmoMmuf2BGg3DbE=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "NUR",
|
"repo": "NUR",
|
||||||
"rev": "8e8775f99549ba721c11643dfe70f4161d5c2f0b",
|
"rev": "6226a48fb329802a63da2babbdd2d375713af333",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -300,43 +111,20 @@
|
|||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"dan": "dan",
|
"dan": "dan",
|
||||||
"helix": "helix",
|
"home-manager": "home-manager",
|
||||||
"home-manager-2205": "home-manager-2205",
|
|
||||||
"nixgl": "nixgl",
|
"nixgl": "nixgl",
|
||||||
"nixos-2205": "nixos-2205",
|
"nixpkgs": "nixpkgs",
|
||||||
"nur": "nur",
|
"nur": "nur",
|
||||||
"unstable": "unstable"
|
"unstable": "unstable"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"rust-overlay": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-utils": "flake-utils",
|
|
||||||
"nixpkgs": [
|
|
||||||
"helix",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1667487142,
|
|
||||||
"narHash": "sha256-bVuzLs1ZVggJAbJmEDVO9G6p8BH3HRaolK70KXvnWnU=",
|
|
||||||
"owner": "oxalica",
|
|
||||||
"repo": "rust-overlay",
|
|
||||||
"rev": "cf668f737ac986c0a89e83b6b2e3c5ddbd8cf33b",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "oxalica",
|
|
||||||
"repo": "rust-overlay",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"unstable": {
|
"unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1668475027,
|
"lastModified": 1699094435,
|
||||||
"narHash": "sha256-1xDT1pAm+NpH6cnjoC4v+xWGoGimiWZnth2bX899RKA=",
|
"narHash": "sha256-YLZ5/KKZ1PyLrm2MO8UxRe4H3M0/oaYqNhSlq6FDeeA=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "032b5c19b09e8bb9b80eba484b58d1b525dc609d",
|
"rev": "9d5d25bbfe8c0297ebe85324addcb5020ed1a454",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
38
flake.nix
38
flake.nix
@@ -1,36 +1,35 @@
|
|||||||
{
|
{
|
||||||
description = "dandellion's home-manager profiles";
|
description = "dandellion's home-manager profiles";
|
||||||
|
|
||||||
nixConfig.extra-substituters = ["https://cache.dodsorf.as"];
|
# nixConfig.extra-substituters = ["https://cache.dodsorf.as"];
|
||||||
nixConfig.exta-trusted-public-keys = "cache.dodsorf.as:FYKGadXTyI2ax8mirBTOjEqS/8PZKAWxiJVOBjESQXc=";
|
# nixConfig.exta-trusted-public-keys = "cache.dodsorf.as:FYKGadXTyI2ax8mirBTOjEqS/8PZKAWxiJVOBjESQXc=";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
home-manager-2205.url = "github:nix-community/home-manager/release-22.05";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
|
||||||
nixos-2205.url = "github:nixos/nixpkgs/nixos-22.05";
|
|
||||||
home-manager-2205.inputs.nixpkgs.follows = "nixos-2205";
|
home-manager.url = "github:nix-community/home-manager/release-23.05";
|
||||||
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||||
|
|
||||||
nur.url = "github:nix-community/NUR";
|
nur.url = "github:nix-community/NUR";
|
||||||
nur.inputs.nixpkgs.follows = "unstable";
|
|
||||||
|
|
||||||
dan.url = "git+https://git2.dodsorf.as/Dandellion/NUR.git"; #"git+https://git.dodsorf.as/Dandellion/NUR";
|
dan.url = "git+https://git.dodsorf.as/Dandellion/NUR.git"; #"git+https://git.dodsorf.as/Dandellion/NUR";
|
||||||
dan.inputs.nixpkgs.follows = "unstable";
|
dan.inputs.nixpkgs.follows = "unstable";
|
||||||
|
|
||||||
helix.url = "github:helix-editor/helix";
|
# helix.url = "github:helix-editor/helix";
|
||||||
helix.inputs.nixpkgs.follows = "unstable";
|
# helix.inputs.nixpkgs.follows = "unstable";
|
||||||
|
|
||||||
nixgl.url = "github:guibou/nixGL";
|
nixgl.url = "github:guibou/nixGL";
|
||||||
nixgl.inputs.nixpkgs.follows = "nixos-2205";
|
nixgl.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {self, home-manager-2205, unstable, nur, dan, nixgl, ... }@inputs:
|
outputs = {self, nixpkgs, home-manager, unstable, nur, dan, nixgl, ... }@inputs:
|
||||||
let
|
let
|
||||||
nixlib = unstable.lib;
|
nixlib = unstable.lib;
|
||||||
|
|
||||||
mkHome =
|
mkHome =
|
||||||
{ machine
|
{ machine
|
||||||
, hmChannel ? home-manager-2205
|
|
||||||
, configuration ? self.nixosModules.home-manager.${machine}
|
, configuration ? self.nixosModules.home-manager.${machine}
|
||||||
, system ? "x86_64-linux"
|
, system ? "x86_64-linux"
|
||||||
, username ? "daniel"
|
, username ? "daniel"
|
||||||
@@ -38,8 +37,17 @@
|
|||||||
, stateVersion ? "22.05"
|
, stateVersion ? "22.05"
|
||||||
, extraSpecialArgs ? { inherit (self) overlays; }
|
, extraSpecialArgs ? { inherit (self) overlays; }
|
||||||
}:
|
}:
|
||||||
hmChannel.lib.homeManagerConfiguration {
|
home-manager.lib.homeManagerConfiguration {
|
||||||
inherit configuration system username homeDirectory stateVersion extraSpecialArgs;
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
modules = [
|
||||||
|
configuration
|
||||||
|
{
|
||||||
|
home = {
|
||||||
|
inherit username homeDirectory stateVersion;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
inherit extraSpecialArgs;
|
||||||
};
|
};
|
||||||
|
|
||||||
mkHomes = machines: extraArgs: nixlib.genAttrs machines (machine: mkHome ({inherit machine; } // extraArgs));
|
mkHomes = machines: extraArgs: nixlib.genAttrs machines (machine: mkHome ({inherit machine; } // extraArgs));
|
||||||
@@ -62,7 +70,7 @@
|
|||||||
inherit (prev) system config;
|
inherit (prev) system config;
|
||||||
};
|
};
|
||||||
dan = dan.packages.${prev.system};
|
dan = dan.packages.${prev.system};
|
||||||
helix = inputs.helix.packages.${prev.system}.helix;
|
# helix = inputs.helix.packages.${prev.system}.helix;
|
||||||
})
|
})
|
||||||
nur.overlay
|
nur.overlay
|
||||||
nixgl.overlay
|
nixgl.overlay
|
||||||
|
|||||||
@@ -12,7 +12,5 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
profiles.base.enable = true;
|
profiles.base.enable = true;
|
||||||
profiles.base.enable = false;
|
|
||||||
|
|
||||||
profiles.zsh.enable = true;
|
profiles.zsh.enable = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
name = "DanixLaptop";
|
name = "DanixLaptop";
|
||||||
eth = "enp0s31f6";
|
eth = "enp0s31f6";
|
||||||
wlan = "wlp5s0";
|
wlan = "wlp5s0";
|
||||||
|
cores = 4;
|
||||||
};
|
};
|
||||||
profiles.base.enable = true;
|
profiles.base.enable = true;
|
||||||
profiles.base.plus = true;
|
profiles.base.plus = true;
|
||||||
|
|||||||
@@ -2,27 +2,20 @@
|
|||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.profiles.base;
|
cfg = config.profiles.base;
|
||||||
|
|
||||||
helixDesktop = pkgs.makeDesktopItem {
|
|
||||||
name = "Helix";
|
|
||||||
type = "Application";
|
|
||||||
desktopName = "Helix";
|
|
||||||
genericName = "Text Editor";
|
|
||||||
comment = "Edit text files";
|
|
||||||
tryExec = "hx";
|
|
||||||
exec = "kitty hx %F";
|
|
||||||
terminal = false; # Until you can globally set a prefered terminal we hardcoding this
|
|
||||||
mimeTypes = [ "ext/english" "text/plain" "text/x-makefile" "text/x-c++hdr" "text/x-c++src" "text/x-chdr" "text/x-csrc" "text/x-java" "text/x-moc" "text/x-pascal" "text/x-tcl" "text/x-tex" "application/x-shellscript" "text/x-c" "text/x-c++" ];
|
|
||||||
categories = [ "Utility" "TextEditor" ];
|
|
||||||
keywords = [ "Text" "editor" ];
|
|
||||||
startupNotify = false;
|
|
||||||
};
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.machine = {
|
options.machine = {
|
||||||
name = lib.mkOption {
|
name = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
};
|
};
|
||||||
|
cores = lib.mkOption {
|
||||||
|
type = lib.types.ints.positive;
|
||||||
|
default = 1;
|
||||||
|
};
|
||||||
|
systemd = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
eth = lib.mkOption { };
|
eth = lib.mkOption { };
|
||||||
wlan = lib.mkOption { };
|
wlan = lib.mkOption { };
|
||||||
secondary-fs = lib.mkOption {
|
secondary-fs = lib.mkOption {
|
||||||
@@ -52,18 +45,25 @@ in
|
|||||||
unstable.comma
|
unstable.comma
|
||||||
|
|
||||||
rnix-lsp
|
rnix-lsp
|
||||||
helixDesktop
|
|
||||||
|
openvpn
|
||||||
|
|
||||||
ldns
|
ldns
|
||||||
mtr
|
mtr
|
||||||
|
nmap
|
||||||
|
inetutils
|
||||||
|
httpie
|
||||||
|
|
||||||
lsof
|
lsof
|
||||||
|
|
||||||
htop
|
htop
|
||||||
|
progress
|
||||||
|
|
||||||
file
|
file
|
||||||
tmux
|
tmux
|
||||||
|
|
||||||
|
timewarrior
|
||||||
|
|
||||||
unzip
|
unzip
|
||||||
p7zip
|
p7zip
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ in
|
|||||||
blender
|
blender
|
||||||
|
|
||||||
mkvtoolnix
|
mkvtoolnix
|
||||||
] ++ lib.optionals (config.nixpkgs.config.allowUnfree && config.profiles.gui.enable) [
|
] ++ lib.optionals (config.profiles.gui.enable && (config ? nixpkgs && config.nixpkgs.config.allowUnfree) ) [
|
||||||
geogebra
|
geogebra
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -134,14 +134,17 @@ in
|
|||||||
url = "https://rycee.gitlab.io/home-manager/options.html#opt-%s";
|
url = "https://rycee.gitlab.io/home-manager/options.html#opt-%s";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
extensions = with pkgs.nur.repos.rycee.firefox-addons; [ bitwarden cookies-txt metamask no-pdf-download sponsorblock ublock-origin ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
extensions = with pkgs.nur.repos.rycee.firefox-addons; [ bitwarden cookies-txt https-everywhere metamask no-pdf-download sponsorblock ublock-origin ];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
programs.obs-studio.enable = (config.profiles.gui.enable && cfg.plus);
|
programs.obs-studio.enable = (config.profiles.gui.enable && cfg.plus);
|
||||||
|
|
||||||
|
|
||||||
|
programs.tealdeer.enable = true;
|
||||||
|
|
||||||
programs.helix = {
|
programs.helix = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.helix;
|
package = pkgs.helix;
|
||||||
@@ -181,7 +184,7 @@ in
|
|||||||
keys.insert = {
|
keys.insert = {
|
||||||
"S-tab" = "unindent";
|
"S-tab" = "unindent";
|
||||||
# Poor man's US-Keyboard
|
# Poor man's US-Keyboard
|
||||||
"Å" = [(c "{}") "move_char_left"];
|
"Å" = [(c "{}") "move_char_right"];
|
||||||
"º" = c "Å";
|
"º" = c "Å";
|
||||||
"^" = c "}";
|
"^" = c "}";
|
||||||
"¤" = c "^";
|
"¤" = c "^";
|
||||||
@@ -217,25 +220,28 @@ in
|
|||||||
n = "!git commit --all --amend --no-edit && git rc";
|
n = "!git commit --all --amend --no-edit && git rc";
|
||||||
};
|
};
|
||||||
ignores = [
|
ignores = [
|
||||||
|
".envrc"
|
||||||
".direnv"
|
".direnv"
|
||||||
|
".devenv"
|
||||||
".vscode"
|
".vscode"
|
||||||
];
|
];
|
||||||
extraConfig = {
|
extraConfig = {
|
||||||
pull.rebase = true;
|
pull.rebase = true;
|
||||||
sequence.editor = let
|
sequence.editor = let
|
||||||
girt = pkgs.unstable.git-interactive-rebase-tool.overrideAttrs (old: rec {
|
# girt = pkgs.unstable.git-interactive-rebase-tool.overrideAttrs (old: rec {
|
||||||
src = pkgs.fetchFromGitHub {
|
# src = pkgs.fetchFromGitHub {
|
||||||
owner = "Dali99";
|
# owner = "Dali99";
|
||||||
repo = "git-interactive-rebase-tool";
|
# repo = "git-interactive-rebase-tool";
|
||||||
rev = "590f87d8ed16992373e214bca5994f89c69fa942";
|
# rev = "590f87d8ed16992373e214bca5994f89c69fa942";
|
||||||
sha256 = "sha256-vUjqnt5ZSpzoohkzDXEqTMhMEkYzPMUZiaYWS0ZQcPQ=";
|
# sha256 = "sha256-vUjqnt5ZSpzoohkzDXEqTMhMEkYzPMUZiaYWS0ZQcPQ=";
|
||||||
};
|
# };
|
||||||
cargoDeps = old.cargoDeps.overrideAttrs (oldB: {
|
# cargoDeps = old.cargoDeps.overrideAttrs (oldB: {
|
||||||
name = "${oldB.name}";
|
# name = "${oldB.name}";
|
||||||
inherit src;
|
# inherit src;
|
||||||
outputHash = "sha256-/I465/PlOckvov9PgSCg7CN5hEKeeQCw8rPsvpKJons=";
|
# outputHash = "sha256-/I465/PlOckvov9PgSCg7CN5hEKeeQCw8rPsvpKJons=";
|
||||||
});
|
# });
|
||||||
});
|
# });
|
||||||
|
girt = pkgs.git-interactive-rebase-tool;
|
||||||
in "${girt}/bin/interactive-rebase-tool";
|
in "${girt}/bin/interactive-rebase-tool";
|
||||||
};
|
};
|
||||||
delta.enable = true;
|
delta.enable = true;
|
||||||
@@ -246,16 +252,15 @@ in
|
|||||||
enable = true;
|
enable = true;
|
||||||
matchBlocks = {
|
matchBlocks = {
|
||||||
"lilith" = {
|
"lilith" = {
|
||||||
hostname = "lilith.d.d.dodsorf.as";
|
hostname = "lilith.daniel";
|
||||||
user = "dandellion";
|
user = "dandellion";
|
||||||
};
|
};
|
||||||
"desktop" = {
|
"desktop" = {
|
||||||
hostname = "10.42.42.10";
|
hostname = "desktop.daniel";
|
||||||
proxyJump = "lilith";
|
|
||||||
user = "dan";
|
user = "dan";
|
||||||
};
|
};
|
||||||
"laptop" = {
|
"laptop" = {
|
||||||
hostname = "10.42.42.13";
|
hostname = "laptop.daniel";
|
||||||
user = "daniel";
|
user = "daniel";
|
||||||
};
|
};
|
||||||
"pvv.ntnu.no" = {
|
"pvv.ntnu.no" = {
|
||||||
@@ -264,13 +269,22 @@ in
|
|||||||
"*.pvv.ntnu.no" = {
|
"*.pvv.ntnu.no" = {
|
||||||
user = "danio";
|
user = "danio";
|
||||||
};
|
};
|
||||||
|
"pascal" = {
|
||||||
|
hostname = "wiki.wackattack.eu";
|
||||||
|
port = 1337;
|
||||||
|
user = "dandellion";
|
||||||
|
};
|
||||||
|
"ireul" = {
|
||||||
|
hostname = "62.92.111.85";
|
||||||
|
port = 1337;
|
||||||
|
user = "dandellion";
|
||||||
|
};
|
||||||
"gitlab.stud.idi.ntnu.no" = {
|
"gitlab.stud.idi.ntnu.no" = {
|
||||||
proxyJump = "login.pvv.ntnu.no";
|
proxyJump = "login.pvv.ntnu.no";
|
||||||
};
|
};
|
||||||
"workshop" = {
|
"consolidation" = {
|
||||||
user = "student";
|
hostname = "62.92.111.62";
|
||||||
hostname = "129.241.99.15";
|
user = "root";
|
||||||
proxyJump = "hildring.pvv.ntnu.no";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ in {
|
|||||||
] ++ lib.optionals config.profiles.gui.enable [
|
] ++ lib.optionals config.profiles.gui.enable [
|
||||||
steam
|
steam
|
||||||
|
|
||||||
unstable.polymc
|
unstable.prismlauncher
|
||||||
# minetest
|
# minetest
|
||||||
# dwarf-fortress-packages.dwarf-fortress-full
|
# dwarf-fortress-packages.dwarf-fortress-full
|
||||||
# superTuxKart
|
# superTuxKart
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ let
|
|||||||
cfg = config.profiles.xsession;
|
cfg = config.profiles.xsession;
|
||||||
non-nixos = config.profiles.non-nixos;
|
non-nixos = config.profiles.non-nixos;
|
||||||
mkGL = program: "${lib.strings.optionalString non-nixos.enable "${pkgs.nixgl.auto.nixGLDefault}/bin/nixGL "}${program}";
|
mkGL = program: "${lib.strings.optionalString non-nixos.enable "${pkgs.nixgl.auto.nixGLDefault}/bin/nixGL "}${program}";
|
||||||
|
execScope = program: "exec bash -c \"systemd-run --user --scope --unit='app-i3-exec-$RANDOM' -p CollectMode=inactive-or-failed -p MemoryHigh=85% -p MemoryMax=92% -p MemorySwapMax=5G -p MemoryAccounting=true \"${program}\"\"";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [ ./dunstrc.nix ./terminal.nix ./polybar.nix ];
|
imports = [ ./dunstrc.nix ./terminal.nix ./polybar.nix ];
|
||||||
@@ -16,6 +17,14 @@ in
|
|||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
profiles.gui.enable = true;
|
profiles.gui.enable = true;
|
||||||
|
|
||||||
|
systemd.user.slices.app.Slice = {
|
||||||
|
MemoryHigh="90%";
|
||||||
|
MemoryMax="94%";
|
||||||
|
MemorySwapMax="8G";
|
||||||
|
CPUQuota="${toString ((config.machine.cores - 1)*100)}%";
|
||||||
|
MemoryAccounting = true;
|
||||||
|
};
|
||||||
|
|
||||||
home.keyboard = {
|
home.keyboard = {
|
||||||
layout = "no";
|
layout = "no";
|
||||||
variant = "nodeadkeys";
|
variant = "nodeadkeys";
|
||||||
@@ -49,6 +58,7 @@ in
|
|||||||
terminal = "${pkgs.kitty}/bin/kitty";
|
terminal = "${pkgs.kitty}/bin/kitty";
|
||||||
keybindings = let
|
keybindings = let
|
||||||
modifier = config.xsession.windowManager.i3.config.modifier;
|
modifier = config.xsession.windowManager.i3.config.modifier;
|
||||||
|
dmenu = if config.machine.systemd then "${../../scripts/dmenu_run_systemd}" else "dmenu_run";
|
||||||
in lib.mkOptionDefault {
|
in lib.mkOptionDefault {
|
||||||
"${modifier}+0" = "workspace 10";
|
"${modifier}+0" = "workspace 10";
|
||||||
"${modifier}+Shift+0" = "move container to workspace 10";
|
"${modifier}+Shift+0" = "move container to workspace 10";
|
||||||
@@ -64,20 +74,45 @@ in
|
|||||||
"XF86MonBrightnessUp" = "exec --no-startup-id brightnessctl set +5%";
|
"XF86MonBrightnessUp" = "exec --no-startup-id brightnessctl set +5%";
|
||||||
"XF86MonBrightnessDown" = "exec --no-startup-id brightnessctl set 5%-";
|
"XF86MonBrightnessDown" = "exec --no-startup-id brightnessctl set 5%-";
|
||||||
|
|
||||||
"XF86Display" = "exec arandr";
|
|
||||||
|
|
||||||
"Print" = "exec scrot %Y-%m-%d_$wx$h_scrot.png -z -e 'mv $f /home/daniel/Pictures/screenshots/'";
|
"Print" = "exec scrot %Y-%m-%d_$wx$h_scrot.png -z -e 'mv $f /home/daniel/Pictures/screenshots/'";
|
||||||
"${modifier}+Print" = "exec scrot /home/daniel/Pictures/Screenshots/%Y-%m-%d_$wx$h_scrot.png -z";
|
"${modifier}+Print" = "exec scrot /home/daniel/Pictures/Screenshots/%Y-%m-%d_$wx$h_scrot.png -z";
|
||||||
|
|
||||||
|
"${modifier}+l" = "exec ${pkgs.writers.writeBash "hello_world" ''
|
||||||
|
dunstctl set-paused true
|
||||||
|
${pkgs.i3lock}/bin/i3lock -n -i ~/images/wallpapers/locked.png
|
||||||
|
dunstctl set-paused false
|
||||||
|
''}";
|
||||||
|
|
||||||
|
"XF86Display" = "exec arandr";
|
||||||
|
|
||||||
"${modifier}+Shift+U" = "exec $HOME/.config/nixpkgs/nix-dotfiles/scripts/dmenuunicode";
|
"${modifier}+Shift+U" = "exec $HOME/.config/nixpkgs/nix-dotfiles/scripts/dmenuunicode";
|
||||||
|
|
||||||
"${modifier}+n" = "exec dolphin";
|
|
||||||
"${modifier}+b" = "exec firefox";
|
|
||||||
"${modifier}+t" = "exec gedit";
|
|
||||||
|
|
||||||
"${modifier}+Shift+s" = "exec $HOME/.config/nixpkgs/nix-dotfiles/scripts/dmenuaudio";
|
"${modifier}+Shift+s" = "exec $HOME/.config/nixpkgs/nix-dotfiles/scripts/dmenuaudio";
|
||||||
|
"${modifier}+Shift+v" = "exec ${pkgs.writers.writeBash "switch_audio" ''
|
||||||
|
if pw-link -l | grep "^VirtualMic:input_FL" -A 2 | grep FilteredMic; then
|
||||||
|
${pkgs.pipewire}/bin/pw-link -d "FilteredMic:capture_MONO" "VirtualMic:input_FL"
|
||||||
|
${pkgs.pipewire}/bin/pw-link -d "FilteredMic:capture_MONO" "VirtualMic:input_FR"
|
||||||
|
${pkgs.pipewire}/bin/pw-link "VoiceChanger:monitor_FL" "VirtualMic:input_FL"
|
||||||
|
${pkgs.pipewire}/bin/pw-link "VoiceChanger:monitor_FR" "VirtualMic:input_FR"
|
||||||
|
${pkgs.pipewire}/bin/pw-link "VoiceChanger:monitor_FL" "VirtualHeadset:playback_FL"
|
||||||
|
${pkgs.pipewire}/bin/pw-link "VoiceChanger:monitor_FR" "VirtualHeadset:playback_FR"
|
||||||
|
else
|
||||||
|
${pkgs.pipewire}/bin/pw-link "FilteredMic:capture_MONO" "VirtualMic:input_FL"
|
||||||
|
${pkgs.pipewire}/bin/pw-link "FilteredMic:capture_MONO" "VirtualMic:input_FR"
|
||||||
|
${pkgs.pipewire}/bin/pw-link -d "VoiceChanger:monitor_FL" "VirtualMic:input_FL"
|
||||||
|
${pkgs.pipewire}/bin/pw-link -d "VoiceChanger:monitor_FR" "VirtualMic:input_FR"
|
||||||
|
${pkgs.pipewire}/bin/pw-link -d "VoiceChanger:monitor_FL" "VirtualHeadset:playback_FL"
|
||||||
|
${pkgs.pipewire}/bin/pw-link -d "VoiceChanger:monitor_FR" "VirtualHeadset:playback_FR"
|
||||||
|
fi
|
||||||
|
''}";
|
||||||
|
|
||||||
# "${modifier}+Return" = lib.mkForce "exec kitty";
|
"${modifier}+d" = "exec ${dmenu}";
|
||||||
"${modifier}+Shift+Return" = "exec kitty -e ssh dandellion@lilith";
|
|
||||||
|
"${modifier}+n" = execScope "dolphin";
|
||||||
|
"${modifier}+b" = execScope "firefox";
|
||||||
|
"${modifier}+t" = execScope "gedit";
|
||||||
|
|
||||||
|
"${modifier}+Return" = execScope "kitty";
|
||||||
|
"${modifier}+Shift+Return" = execScope "kitty -e ssh dandellion@lilith";
|
||||||
};
|
};
|
||||||
startup = [
|
startup = [
|
||||||
{
|
{
|
||||||
@@ -90,14 +125,19 @@ in
|
|||||||
titlebar = false;
|
titlebar = false;
|
||||||
hideEdgeBorders = "smart";
|
hideEdgeBorders = "smart";
|
||||||
};
|
};
|
||||||
|
floating.criteria = [
|
||||||
|
{ title = "Steam - Update News"; }
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
i3.extraConfig = ''
|
||||||
|
for_window [title="Steam Big Picture Mode"] floating enable, resize set 1920 1080, move position 0 0, border pixel 0
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.picom = {
|
services.picom = {
|
||||||
enable = true;
|
enable = true;
|
||||||
backend = "xrender";
|
backend = "xrender";
|
||||||
experimentalBackends = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -68,8 +68,17 @@ in
|
|||||||
programs.direnv = {
|
programs.direnv = {
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
programs.atuin = {
|
||||||
|
enable = true;
|
||||||
|
enableZshIntegration = true;
|
||||||
|
settings = {
|
||||||
|
filter_mode = "directory";
|
||||||
|
filter_mode_shell_up_key_binding = "session";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
home.packages = [
|
home.packages = lib.optionals (config.profiles.gui.enable && config ? nixpkgs) [
|
||||||
pkgs.dan.mesloNFp10k
|
pkgs.dan.mesloNFp10k
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|||||||
140
scripts/dmenu_run_systemd
Executable file
140
scripts/dmenu_run_systemd
Executable file
@@ -0,0 +1,140 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
#
|
||||||
|
# dmenu_run_systemd: start a program from dmenu as transient systemd .scope
|
||||||
|
# (C) Copyright Benjamin Block 2021
|
||||||
|
# (C) Copyright Daniel Olsen 2023
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
|
# copy of this software and associated documentation files (the "Software"),
|
||||||
|
# to deal in the Software without restriction, including without limitation
|
||||||
|
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
# and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
# Software is furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice (including the next
|
||||||
|
# paragraph) shall be included in all copies or substantial portions of the
|
||||||
|
# Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
|
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
|
# DEALINGS IN THE SOFTWARE.
|
||||||
|
#
|
||||||
|
# Requirements:
|
||||||
|
# - Package: bash
|
||||||
|
# - Package: dmenu
|
||||||
|
# - dmenu_path
|
||||||
|
# - dmenu
|
||||||
|
# - Package: coreutils
|
||||||
|
# - basenc
|
||||||
|
# - tr
|
||||||
|
# - Package: systemd
|
||||||
|
# - systemd-run
|
||||||
|
# - Package: util-linux
|
||||||
|
# - getopt
|
||||||
|
#
|
||||||
|
# Usage: dmenu_run_systemd
|
||||||
|
#
|
||||||
|
# Start demnu to select program to execute, then start selected program in
|
||||||
|
# background.
|
||||||
|
#
|
||||||
|
# Usage: dmenu_run_systemd [Options] [--] <command> [<arg1>[, <arg2>[...]]]
|
||||||
|
#
|
||||||
|
# Start <command> with <arg1..N> without involving dmenu.
|
||||||
|
# E.g. in i3 config: `bindsym $mod+Return exec dmenu_run_systemd alacritty`.
|
||||||
|
#
|
||||||
|
# Options:
|
||||||
|
# -f, --forground Start <command> as forground task (default: no)
|
||||||
|
# -p, --pwd Use the current ${PWD} as working directory (default:
|
||||||
|
# ${HOME})
|
||||||
|
|
||||||
|
declare -g prefix forground=false cpwd=false
|
||||||
|
declare -ga selection
|
||||||
|
if [ "${#}" -lt 1 ]; then
|
||||||
|
prefix="dmenu-"
|
||||||
|
selection=("$(dmenu_path | dmenu)") || exit 127
|
||||||
|
else
|
||||||
|
prefix="xrun-"
|
||||||
|
|
||||||
|
declare opts
|
||||||
|
opts="$(getopt --shell bash \
|
||||||
|
-o "fp" \
|
||||||
|
-l "forground,pwd" \
|
||||||
|
-n "dmenu_run_systemd" -- "${@}")" || exit 122
|
||||||
|
eval set -- "${opts}"
|
||||||
|
unset opts
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
case "${1}" in
|
||||||
|
'-f'|'--forground')
|
||||||
|
forground=true
|
||||||
|
;;
|
||||||
|
'-p'|'--pwd')
|
||||||
|
cpwd=true
|
||||||
|
;;
|
||||||
|
'--') shift; break;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
selection=("${@}")
|
||||||
|
fi
|
||||||
|
readonly selection prefix
|
||||||
|
|
||||||
|
declare -g name
|
||||||
|
# Max unit name length: 256
|
||||||
|
# - ".scope" - 6
|
||||||
|
# - "<prefix>-" - 6
|
||||||
|
# - "-<rand>" - 33
|
||||||
|
# ------
|
||||||
|
# "<name>" <= 211
|
||||||
|
read -r -d '' -n 192 name < <(
|
||||||
|
echo -n "${selection[*]}" | tr -c 'a-zA-Z0-9_-' '[_*]' || exit 1
|
||||||
|
echo -e '\0' || exit 2
|
||||||
|
) || exit 126
|
||||||
|
readonly name
|
||||||
|
{ [ "${#name}" -gt 0 ] && [ "${#name}" -le 211 ]; } || exit 125
|
||||||
|
|
||||||
|
declare -g rand
|
||||||
|
# ~5 bits per character => 32*5 = ~160 bits random number
|
||||||
|
read -r -N 32 rand < <(basenc --base32 < /dev/urandom) || exit 124
|
||||||
|
readonly rand
|
||||||
|
[ "${#rand}" -eq 32 ] || exit 123
|
||||||
|
|
||||||
|
declare -ga runargs=(
|
||||||
|
--quiet
|
||||||
|
--user # run in per-User slice
|
||||||
|
--scope # create transient `.scope` unit,
|
||||||
|
# instead of `.service`
|
||||||
|
--collect # garbage collect everything after run,
|
||||||
|
# even on failure
|
||||||
|
--slice="app.slice" # run as part of `app.slice`
|
||||||
|
--unit="${prefix}${name}-${rand}"
|
||||||
|
|
||||||
|
-p MemoryHigh=85%
|
||||||
|
-p MemoryMax=92%
|
||||||
|
-p MemorySwapMax=5G
|
||||||
|
# unit name
|
||||||
|
--description="dmenu selection ${selection[*]@Q}"
|
||||||
|
)
|
||||||
|
|
||||||
|
if ${cpwd}; then
|
||||||
|
runargs+=( --working-directory="${PWD:-/}" )
|
||||||
|
else
|
||||||
|
runargs+=( --working-directory="${HOME:-/}" )
|
||||||
|
fi
|
||||||
|
|
||||||
|
readonly runargs
|
||||||
|
|
||||||
|
## Debugging:
|
||||||
|
#declare -p prefix selection name rand runargs
|
||||||
|
|
||||||
|
if ${forground}; then
|
||||||
|
systemd-run "${runargs[@]}" -- "${selection[@]}"
|
||||||
|
else
|
||||||
|
systemd-run "${runargs[@]}" -- "${selection[@]}" &
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user