a lot of things...

This commit is contained in:
Sebastian Moser
2024-12-02 20:00:51 +01:00
parent d132ce5342
commit 87adea3ded
14 changed files with 309 additions and 138 deletions

View File

@@ -25,7 +25,7 @@
'';
nix.settings = {
experimental-features = lib.mkDefault "nix-command flakes";
experimental-features = lib.mkDefault "nix-command flakes repl-flake";
trusted-users = [ "root" "@wheel" ];
};
nixpkgs.config.allowUnfree = true;

228
flake.lock generated
View File

@@ -717,11 +717,11 @@
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1720400604,
"narHash": "sha256-WEXYDYBQYw/JyA9bKlgxbUJaArR8AztVUPSAwvZTWfc=",
"lastModified": 1729272011,
"narHash": "sha256-qZath4ja2WroJy8xtIQ7dsdrOdOVkDqNYAxylb8J53E=",
"owner": "nix-community",
"repo": "flake-firefox-nightly",
"rev": "38cb4904ef9781cb4e6167a000fb3772bc4dcf05",
"rev": "12c63e2cd89951f7ca39b78ecb817138f8408f43",
"type": "github"
},
"original": {
@@ -739,11 +739,11 @@
},
"locked": {
"dir": "pkgs/firefox-addons",
"lastModified": 1720411406,
"narHash": "sha256-Z3tMBbMeYQKz1YYmSnbLglG9lm1l/EU+h3CFPJCli4I=",
"lastModified": 1729260790,
"narHash": "sha256-QhsyaQ7PAJ3W0k2oYoNkCwBTd+Sr6Z2IZfU8o7j7cKY=",
"owner": "rycee",
"repo": "nur-expressions",
"rev": "a2a2d880d5ec199ee333c9bf929865d65f92a1d4",
"rev": "5fb9e4cb8f9c47d0edac20d23c39f878a7602e5b",
"type": "gitlab"
},
"original": {
@@ -864,6 +864,22 @@
"type": "github"
}
},
"flake-compat_10": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_2": {
"flake": false,
"locked": {
@@ -995,11 +1011,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github"
},
"original": {
@@ -1265,11 +1281,11 @@
"systems": "systems_2"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github"
},
"original": {
@@ -1301,11 +1317,11 @@
"systems": "systems_4"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"lastModified": 1726560853,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a",
"type": "github"
},
"original": {
@@ -1435,11 +1451,11 @@
]
},
"locked": {
"lastModified": 1720042825,
"narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=",
"lastModified": 1726989464,
"narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073",
"rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176",
"type": "github"
},
"original": {
@@ -1518,34 +1534,17 @@
"type": "github"
}
},
"keyboard-config": {
"flake": false,
"locked": {
"lastModified": 1711025888,
"narHash": "sha256-TYzL9WNRdaGEEGjA/oX3964vJCovEiSbqI7th02uuys=",
"owner": "eigatech",
"repo": "zmk-config",
"rev": "6f1358bc34f9c97e32533ba11f4e4020507709ff",
"type": "github"
},
"original": {
"owner": "eigatech",
"ref": "charybdis-3.5",
"repo": "zmk-config",
"type": "github"
}
},
"lib-aggregate": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1720354218,
"narHash": "sha256-cyl6Cxqo4bNmwLXi8/qIc3U1vRJ9VyIBUL/j3is4x58=",
"lastModified": 1728821524,
"narHash": "sha256-Tc4g0n0WxGLLUJYJwrhSE3/l05xUcREEx9y+R4Gi4RA=",
"owner": "nix-community",
"repo": "lib-aggregate",
"rev": "5865544e7c012ecaa952f5c6cf5878c1676b52b4",
"rev": "8921856c37862428741a29cfd4c98c4893ca407d",
"type": "github"
},
"original": {
@@ -1937,11 +1936,11 @@
]
},
"locked": {
"lastModified": 1701208414,
"narHash": "sha256-xrQ0FyhwTZK6BwKhahIkUVZhMNk21IEI1nUcWSONtpo=",
"lastModified": 1720066371,
"narHash": "sha256-uPlLYH2S0ACj0IcgaK9Lsf4spmJoGejR9DotXiXSBZQ=",
"owner": "nix-community",
"repo": "nix-github-actions",
"rev": "93e39cc1a087d65bcf7a132e75a650c44dd2b734",
"rev": "622f829f5fe69310a866c8a6cd07e747c44ef820",
"type": "github"
},
"original": {
@@ -1957,11 +1956,11 @@
]
},
"locked": {
"lastModified": 1720334033,
"narHash": "sha256-X9pEvvHTVWJphhbUYqXvlLedOndNqGB7rvhSvL2CIgU=",
"lastModified": 1728790083,
"narHash": "sha256-grMdAd4KSU6uPqsfLzA1B/3pb9GtGI9o8qb0qFzEU/Y=",
"owner": "Mic92",
"repo": "nix-index-database",
"rev": "685e40e1348007d2cf76747a201bab43d86b38cb",
"rev": "5c54c33aa04df5dd4b0984b7eb861d1981009b22",
"type": "github"
},
"original": {
@@ -2164,11 +2163,11 @@
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1720428387,
"narHash": "sha256-0vHxVNWTql555MZLb2kngrcjfNtsJKoYdyUivTibgnc=",
"lastModified": 1729203674,
"narHash": "sha256-WKB5NhenAnCXLK4zb5+qXYaBdh6th1DrdUj599HwvCw=",
"owner": "nix-community",
"repo": "NixOS-WSL",
"rev": "30ebd0beb2ed26e09bcd245d757504029f807cce",
"rev": "c75a9a62b283c67f5805ea5fd65de994c45872bc",
"type": "github"
},
"original": {
@@ -2219,11 +2218,11 @@
},
"nixlib": {
"locked": {
"lastModified": 1719708727,
"narHash": "sha256-XFNKtyirrGNdehpg7lMNm1skEcBApjqGhaHc/OI95HY=",
"lastModified": 1728781282,
"narHash": "sha256-hUP9oxmnOmNnKcDOf5Y55HQ+NnoT0+bLWHLQWLLw9Ks=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "1bba8a624b3b9d4f68db94fb63aaeb46039ce9e6",
"rev": "16340f605f4e8e5cf07fd74dcbe692eee2d4f51b",
"type": "github"
},
"original": {
@@ -2270,11 +2269,11 @@
]
},
"locked": {
"lastModified": 1720055043,
"narHash": "sha256-SKizewU4UeYrkZWPUjur8EoxscGoNb0pGcrNL4YzAIg=",
"lastModified": 1729127034,
"narHash": "sha256-42AMGl+dh4I2wGgICSeDI1mqYaDEJhwqquHJ1vA0QiQ=",
"owner": "nix-community",
"repo": "nixos-generators",
"rev": "168b220231a70e47cc1f0919048fa5914415fb18",
"rev": "dd28a0806e7124fe392c33c9ccaa12f21970401f",
"type": "github"
},
"original": {
@@ -2333,11 +2332,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1720429258,
"narHash": "sha256-d6JI5IgJ1xdrk7DvYVx7y8ijcYz5I1nhCwOiDP6cq00=",
"lastModified": 1728729581,
"narHash": "sha256-oazkQ/z7r43YkDLLQdMg8oIB3CwWNb+2ZrYOxtLEWTQ=",
"owner": "nixos",
"repo": "nixos-hardware",
"rev": "72d3c007024ce47d838bb38693c8773812f54bf2",
"rev": "a8dd1b21995964b115b1e3ec639dd6ce24ab9806",
"type": "github"
},
"original": {
@@ -2378,11 +2377,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1720031269,
"narHash": "sha256-rwz8NJZV+387rnWpTYcXaRNvzUSnnF9aHONoJIYmiUQ=",
"lastModified": 1728888510,
"narHash": "sha256-nsNdSldaAyu6PE3YUA+YQLqUDJh+gRbBooMMekZJwvI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "9f4128e00b0ae8ec65918efeba59db998750ead6",
"rev": "a3c0b3b21515f74fd2665903d4ce6bc4dc81c77c",
"type": "github"
},
"original": {
@@ -2490,11 +2489,11 @@
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1720313561,
"narHash": "sha256-arht1SYnZ5hJl1COIuqbdRi8ibpnNtc9zUZLmU9xqTs=",
"lastModified": 1728781282,
"narHash": "sha256-hUP9oxmnOmNnKcDOf5Y55HQ+NnoT0+bLWHLQWLLw9Ks=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "770d42db0b8203bdd84ddbd707a49fe0a3638863",
"rev": "16340f605f4e8e5cf07fd74dcbe692eee2d4f51b",
"type": "github"
},
"original": {
@@ -2549,13 +2548,35 @@
"type": "github"
}
},
"nixpkgs-python": {
"inputs": {
"flake-compat": "flake-compat_10",
"nixpkgs": [
"zephyr-nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1722978926,
"narHash": "sha256-sqOOEaKJJSUFBzag/cGeeXV491TrrVFY3DFBs1w20V8=",
"owner": "cachix",
"repo": "nixpkgs-python",
"rev": "7c550bca7e6cf95898e32eb2173efe7ebb447460",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "nixpkgs-python",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1720031269,
"narHash": "sha256-rwz8NJZV+387rnWpTYcXaRNvzUSnnF9aHONoJIYmiUQ=",
"lastModified": 1728888510,
"narHash": "sha256-nsNdSldaAyu6PE3YUA+YQLqUDJh+gRbBooMMekZJwvI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9f4128e00b0ae8ec65918efeba59db998750ead6",
"rev": "a3c0b3b21515f74fd2665903d4ce6bc4dc81c77c",
"type": "github"
},
"original": {
@@ -2865,11 +2886,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1720244366,
"narHash": "sha256-WrDV0FPMVd2Sq9hkR5LNHudS3OSMmUrs90JUTN+MXpA=",
"lastModified": 1728740863,
"narHash": "sha256-u+rxA79a0lyhG+u+oPBRtTDtzz8kvkc9a6SWSt9ekVc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "49ee0e94463abada1de470c9c07bfc12b36dcf40",
"rev": "a3f9ad65a0bf298ed5847629a57808b97e6e8077",
"type": "github"
},
"original": {
@@ -2881,11 +2902,11 @@
},
"nixpkgs_4": {
"locked": {
"lastModified": 1720429184,
"narHash": "sha256-rDfR+hELWZeMRVvVN5efpMMpOZsPQXgl3HK1N1hAkaM=",
"lastModified": 1729275015,
"narHash": "sha256-p9+3KzsoqBVPOY7OlW+C5F0CwSWYApNKbInRb/zenfo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ea6033ce4ddf2c0ede2ea147a450d4f880796128",
"rev": "b9562c824b11473587286eb499680129c2d0d4f1",
"type": "github"
},
"original": {
@@ -3166,11 +3187,11 @@
},
"nur": {
"locked": {
"lastModified": 1720439178,
"narHash": "sha256-ASwgeUB0kIZm4/zurVa3jez/ePDGlIa1j9KhFR3btkY=",
"lastModified": 1729273642,
"narHash": "sha256-60KkzIqBMxOii63HaduvSQw49SMzFYrZC9TgxPKb+oU=",
"owner": "nix-community",
"repo": "NUR",
"rev": "15e84beae2b0a7e4ab2e23403ef867b05d32d44b",
"rev": "2a8bcc9cd7adcd1722ce7f01f839fbbfa3de0ef9",
"type": "github"
},
"original": {
@@ -3498,14 +3519,15 @@
"nixpkgs": [
"zephyr-nix",
"nixpkgs"
]
],
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1708414356,
"narHash": "sha256-neHF92cht4G94Ye1j9YgLeqdE0dGL920lQQMLTqNm9A=",
"lastModified": 1724569826,
"narHash": "sha256-87KKENLQoxpzbONnDaUEaraJ7UNsArj+MJqiYvFePtk=",
"owner": "nix-community",
"repo": "pyproject.nix",
"rev": "f75d39ce888632500bf4cff2197784929d3ed265",
"rev": "225a7503959812f0c60d42ca7904adb753151759",
"type": "github"
},
"original": {
@@ -3629,7 +3651,6 @@
"flake-utils": "flake-utils_3",
"home-manager": "home-manager",
"home-manager-old": "home-manager-old",
"keyboard-config": "keyboard-config",
"networkmanager": "networkmanager",
"nix-doom-emacs": "nix-doom-emacs",
"nix-index-database": "nix-index-database",
@@ -4018,6 +4039,28 @@
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"zephyr-nix",
"pyproject-nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1724338379,
"narHash": "sha256-kKJtaiU5Ou+e/0Qs7SICXF22DLx4V/WhG1P6+k4yeOE=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "070f834771efa715f3e74cd8ab93ecc96fabc951",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
},
"ts-fold": {
"flake": false,
"locked": {
@@ -4077,11 +4120,11 @@
]
},
"locked": {
"lastModified": 1718483096,
"narHash": "sha256-Kk39E63V95tu/JcmCvOK0Vma6ixsqaSZUw6E0GKYtMw=",
"lastModified": 1725004889,
"narHash": "sha256-Xj/aESN3yeMMVfmL05HXt7gMLv+W4yNB8RcNSk6FweQ=",
"owner": "c2vi",
"repo": "victorinix",
"rev": "7985cb0a9da32d3d089dcd70add36dda6dfa1971",
"rev": "690aa83bc3b37263b1aeab61b3bd8f84960e0b1e",
"type": "github"
},
"original": {
@@ -4165,16 +4208,16 @@
"zephyr": {
"flake": false,
"locked": {
"lastModified": 1708734632,
"narHash": "sha256-iwEXEIA63JWSB6GcTNHHMZAEfMEwEfqcIWetF7VD2tU=",
"lastModified": 1721992675,
"narHash": "sha256-rmOHH0uRU27U2T4w4+FEMcAcuiZ7W7p4vOwtSwiAFNY=",
"owner": "zephyrproject-rtos",
"repo": "zephyr",
"rev": "468eb56cf242eedba62006ee758700ee6148763f",
"rev": "36940db938a8f4a1e919496793ed439850a221c2",
"type": "github"
},
"original": {
"owner": "zephyrproject-rtos",
"ref": "v3.6.0",
"ref": "v3.7.0",
"repo": "zephyr",
"type": "github"
}
@@ -4184,15 +4227,16 @@
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-python": "nixpkgs-python",
"pyproject-nix": "pyproject-nix",
"zephyr": "zephyr"
},
"locked": {
"lastModified": 1720132542,
"narHash": "sha256-5o5qhBec7GABj/x3LPOVQn8W9iyyLTqH+FMLe454HOc=",
"lastModified": 1728427970,
"narHash": "sha256-NoPOzNkvLE5ilU88aLtUJ7145uHp+6fuKmwnHphoItU=",
"owner": "adisbladis",
"repo": "zephyr-nix",
"rev": "6339867e76405b7e84270b908c2ab6deca5f6d8d",
"rev": "650721ce8cc5c7d44e73b9873b2c24d49793e586",
"type": "github"
},
"original": {
@@ -4208,11 +4252,11 @@
]
},
"locked": {
"lastModified": 1720312285,
"narHash": "sha256-oa3UxPaqFSdPlcB4CxQK9L4NTDV/pcubItrIda5yadM=",
"lastModified": 1728779707,
"narHash": "sha256-CBwMbCD++SHfXVS9zrVR8XXkfmTdGC0MbnJ0vWh/09w=",
"owner": "lilyinstarlight",
"repo": "zmk-nix",
"rev": "b801185a6e260faffc6459d2009626262abc779f",
"rev": "b54456b95b84aca6cb087bc75a68e34031fbeed2",
"type": "github"
},
"original": {

View File

@@ -80,10 +80,6 @@
zmk-nix = {
url = "github:lilyinstarlight/zmk-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
keyboard-config = {
url = "github:eigatech/zmk-config/charybdis-3.5";
flake = false;
};
};

View File

@@ -11,6 +11,8 @@
# fileSystems."/".options = [ "noatime" "nodiratime" "discard" ];
services.nscd.enable = lib.mkForce false;
virtualisation.docker.enable = true;
system.nssModules = lib.mkForce [];
services.xserver.enableTCP = true;

View File

@@ -197,11 +197,11 @@
ip=$(curl my.ip.fi)
curl "http://dynv6.com/api/update?hostname=${builtins.readFile "${secretsDir}/dns-name-two"}&ipv4=$ip&token=${builtins.readFile "${secretsDir}/dns-name-two-token"}"
curl "https://dynamicdns.park-your-domain.com/update?host=home&domain=${builtins.readFile "${secretsDir}/dns-name"}&password=${builtins.readFile "${secretsDir}/dns-name-token"}&ip=$ip"
curl "https://dynamicdns.park-your-domain.com/update?host=mc&domain=c2vi.dev&password=${builtins.readFile "${secretsDir}/dns-name-token"}&ip=$ip"
# https://www.namecheap.com/support/knowledgebase/article.aspx/29/11/how-to-dynamically-update-the-hosts-ip-with-an-https-request/
'';
};
#curl "https://dynamicdns.park-your-domain.com/update?host=mc&domain=c2vi.dev&password=${builtins.readFile "${secretsDir}/dns-name-token"}&ip=$ip"
in
{
enable = true;

View File

@@ -18,6 +18,13 @@ import XMonad.Hooks.SetWMName
import XMonad.Hooks.EwmhDesktops
import Data.Monoid
import qualified Data.Map as M
import XMonad
import Control.Monad
import qualified XMonad.StackSet as W
import qualified Data.Map as M
@@ -37,6 +44,7 @@ myClickJustFocuses = False
-- Width of the window border in pixels.
--
myBorderWidth = 2
-- myBorderWidth = 0
-- modMask lets you specify which modkey you want to use. The default
-- is mod1Mask ("left alt"). You may also consider using mod3Mask
@@ -78,6 +86,7 @@ myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList $
--((button2), spawn "xinput enable 17"),
--((modm .|. button2, \w -> focus w >> windows W.shiftMaster),
((noModMask, xK_Page_Up), spawn "alacritty" ),
-- player next
((modm, xK_n), spawn "playerctl next"),
@@ -263,7 +272,7 @@ myManageHook = composeAll
-- return (All True) if the default handler is to be run afterwards. To
-- combine event hooks use mappend or mconcat from Data.Monoid.
--
myEventHook = ewmhFullscreen
--myEventHook = ewmhFullscreen `mappend` keyUpEventHook
------------------------------------------------------------------------
-- Status bars and logging
@@ -310,7 +319,7 @@ myConfig = ewmh def {
-- hooks, layouts
layoutHook = myLayout,
manageHook = myManageHook,
handleEventHook = handleEventHook def <+> fullscreenEventHook,
handleEventHook = handleEventHook def, -- <+> keyUpEventHook, -- <+> fullscreenEventHook ,
logHook = myLogHook,
startupHook = myStartupHook
}
@@ -367,3 +376,26 @@ help = unlines ["The default modifier key is 'alt'. Default keybindings:",
"mod-button1 Set the window to floating mode and move by dragging",
"mod-button2 Raise the window to the top of the stack",
"mod-button3 Set the window to floating mode and resize by dragging"]
-- me trying to get key up to be handeled
keyUpEventHook :: Event -> X All
keyUpEventHook e = handle e >> return (All True)
keyUpKeys (XConf{ config = XConfig {XMonad.modMask = modMask} }) = M.fromList $
[ ((noModMask, xK_Page_Up), spawn "mshot" ) ]
handle :: Event -> X ()
handle (KeyEvent {ev_event_type = t, ev_state = m, ev_keycode = code})
| t == keyRelease = withDisplay $ \dpy -> do
s <- io $ keycodeToKeysym dpy code 0
mClean <- cleanMask m
ks <- asks keyUpKeys
userCodeDef () $ whenJust (M.lookup (mClean, s) ks) id
handle _ = return ()

View File

@@ -10,11 +10,11 @@ rustPlatform.buildRustPackage rec {
src = fetchFromGitHub {
owner = "henkelmax";
repo = "svc-cli-utils";
rev = "master";
sha256 = "sha256-37kyRO0ojhzJgctbopVyLA0ttK/vYTMIoGYFdZy6hy4=";
rev = "82e0af5b5e4cb0aa60bfeea4f9b1d3929fe4e1f8";
sha256 = "sha256-ojuRqtUTNz/ZOuxx3ab1y9NknEfJNWPMXBf3kfIwfXM=";
};
cargoHash = "sha256-h2AqkDo9Lvi6G0ZUk+MlzXeFwC/d9AKKWgXUPqSUOEs=";
cargoHash = "sha256-VvA7xlj7zcuHDNi4+TRSDheCchjpiK519OgNTJj2hPI=";
meta = with lib; {
description = "Command line utilities for the Simple Voice Chat Minecraft Mod";

View File

@@ -138,6 +138,9 @@
#################### functions ####################
nrel(){
nix repl --expr "rec { nixpkgs = builtins.getFlake \"nixpkgs\"; pkgs = import nixpkgs {}; flake = builtins.getFlake \"git+file://$(pwd)\"; out = flake.packages.x86_64-linux;} $@"
}
# shortcut for copying over to tab
tta(){

View File

@@ -1,15 +1,20 @@
{ ... }:
{ pkgs, ... }:
{
programs.git = {
enable = true;
userName = "Sebastian Moser";
userEmail = "sebastian@c2vi.dev";
extraConfig.credential.helper = "manager";
extraConfig.credential."https://git.htlec.org".username = "c2vi";
extraConfig.credential.credentialStore = "cache";
extraConfig = {
core.editor = "nvim";
core.color.ui = true;
core.pager = "delta";
extraConfig.core.excludesfile = "~/.config/git/gitignore";
core.excludesfile = "~/.config/git/gitignore";
};
};
home.packages = [ pkgs.git-credential-manager ];
}

View File

@@ -5,6 +5,20 @@
matchBlocks = {
"*" = {
identityFile = "${secretsDir}/private-key";
};
pcmc = {
hostname = "195.201.148.94";
user = "root";
};
ligai = {
hostname = "ssh.lightning.ai";
identityFile = "~/work/here/secrets/lightning-ai-key";
#IdentitiesOnly = "yes";
#ServerAliveInterval = 15;
#ServerAliveCountMax = 4;
#StrictHostKeyChecking = "no";
#UserKnownHostsFile = "/dev/null";
user = "s_01j7xkk335kbnr7r19zhssxn29";
};
"github.com" = {
hostname = "github.com";

View File

@@ -3,8 +3,43 @@
...
}: let
pkgs = import nixpkgs { inherit system; };
lib = pkgs.lib;
in rec {
qtrs = pkgs.stdenv.mkDerivation {
name = "qt rust bindings";
nativeBuildInputs = with pkgs; [
openssl
pkg-config
sqlite
#clang
#libclang.dev
#libclang
#libclang.lib
cargo
libsForQt5.qt5.full
];
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
RITUAL_STD_HEADERS = "${pkgs.libcxx.dev}/include/c++/v1";
buildInputs = with pkgs; [
libclang.dev
libclang.lib
sqlite
libsForQt5.qt5.full
];
dontUnpack = true;
dontPatch = true;
buildPhase = ''
cargo test
'';
};
zephyr = inputs.zephyr-nix.packages.${system};
@@ -89,8 +124,10 @@ in rec {
};
yt-block = pkgs.callPackage ./scripts/yt-block/app.nix {};
unkillableKernelModule = mypkgs.callPackage ./mods/unkillable-process-kernel-module.nix {
unkillableKernelModule = mypkgs.callPackage ./scripts/yt-block/unkillable-process-kernel-module.nix {
kernel = self.nixosConfigurations.main.config.boot.kernelPackages.kernel;
};

View File

@@ -17,11 +17,36 @@ DEFAULT_STATE = {
"yt_time_left": 0,
"yt_time_current": 0,
"date": "2024-07-15",
"yt_ips": [
"142.251.208.174",
"142.251.208.142",
"142.251.208.110",
"142.251.39.78",
"142.251.39.46",
"142.251.39.14",
"142.250.201.206",
"142.250.180.238",
"142.250.180.206",
"172.217.20.14",
"172.217.19.110",
"188.21.9.20",
"142.251.208.142",
"188.21.9.34",
"188.21.9.31",
# "2a00:1450:400d:80d::200e",
# "2a00:1450:400d:80c::200e",
# "2a00:1450:400d:802::200e",
# "2a00:1450:400d:80e::200e",
]
}
YT_HOSTS = [
[ "127.0.0.1", "youtube.com" ],
[ "127.0.0.1", "www.youtube.com" ],
[ "127.0.0.1", "1e100.net" ],
[ "::1", "1e100.net" ],
[ "::1", "www.youtube.com" ],
[ "::1", "youtube.com" ],
]
@@ -39,12 +64,30 @@ def main():
cmd_info()
return
if sys.argv[1] == "a" or sys.argv[1] == "add-yt-addr":
cmd_add_addr()
return
if sys.argv[1] == "s" or sys.argv[1] == "starter":
cmd_starter()
return
print("unknown command!!!!")
def cmd_add_addr():
pwd = get_pwd()
state = read_state(pwd)
try:
ip = sys.argv[2]
state["yt_ips"].append(ip)
except:
print("empty ip.... printing all ips")
for ip in state["yt_ips"]:
print("ip:", ip)
write_state(state, pwd)
def cmd_guard():
pwd = get_pwd()
@@ -53,9 +96,9 @@ def cmd_guard():
# if it's after 22:00 block yt and kill all minecraft processes
now = datetime.datetime.now()
if now.hour >= 21:
if now.hour >= 21 or now.hour <= 8:
print("after 21:00 blocking....")
block_yt()
block_yt(state)
kill_mc()
return
@@ -68,11 +111,11 @@ def cmd_guard():
# if time_current in state is 0, block yt
if state["yt_time_current"] == 0:
block_yt()
block_yt(state)
# if time_current in state is greater than 0, unblock yt
if state["yt_time_current"] > 0:
unblock_yt()
unblock_yt(state)
# decrement time_current
if state["yt_time_current"] > 0:
@@ -182,41 +225,26 @@ def write_hosts(hosts):
file.write("\n".join(lines) + "\n")
def block_yt():
def block_yt(state):
yt_ips = state["yt_ips"]
hosts = get_hosts()
for entry in YT_HOSTS:
if entry not in hosts:
hosts.append(entry)
write_hosts(hosts)
yt_ips = [
"142.251.208.174",
"142.251.208.142",
"142.251.208.110",
"142.251.39.78",
"142.251.39.46",
"142.251.39.14",
"142.250.201.206",
"142.250.180.238",
"142.250.180.206",
"172.217.20.14",
"172.217.19.110",
"188.21.9.20",
"142.251.208.142",
# "2a00:1450:400d:80d::200e",
# "2a00:1450:400d:80c::200e",
# "2a00:1450:400d:802::200e",
# "2a00:1450:400d:80e::200e",
]
# the ips, that should be blocked incoming as well
#yt_ips_incoming [
#]
os.system("iptables -N YTBLOCK")
print("running: iptables -N YTBLOCK")
os.system("iptables -D OUTPUT -j YTBLOCK")
os.system("iptables -D INPUT -j YTBLOCK")
os.system("iptables -I OUTPUT -j YTBLOCK")
os.system("iptables -I INPUT -d 188.21.9.20 -j REJECT")
os.system("iptables -I INPUT -j YTBLOCK")
print("running: iptables -I OUTPUT -j YTBLOCK")
for ip in yt_ips:
@@ -225,7 +253,7 @@ def block_yt():
print(f"running: iptables -I YTBLOCK -d {ip} -j REJECT")
#os.system("iptables -I OUTPUT -d -j REJECT")
def unblock_yt():
def unblock_yt(state):
hosts = get_hosts()
new_hosts = []
for entry in hosts:
@@ -238,10 +266,11 @@ def unblock_yt():
os.system("iptables -F YTBLOCK")
print("running: iptables -F YTBLOCK")
os.system("iptables -D INPUT -j YTBLOCK")
os.system("iptables -D INPUT -j YTBLOCK")
os.system("iptables -D OUTPUT -j YTBLOCK")
os.system("iptables -D OUTPUT -j YTBLOCK")
os.system("iptables -D OUTPUT -j YTBLOCK")
os.system("iptables -D INPUT -d 188.21.9.20 -j REJECT")
print("running 3 times: iptables -D OUTPUT -j YTBLOCK")
os.system("iptables -X YTBLOCK")
@@ -278,9 +307,16 @@ def cmd_starter():
file.write(str(pid))
#pass
pwd = get_pwd()
state = read_state(pwd)
while True:
print("file:", __file__)
# write the state file again in case it is missing, so i can't juste delete it, to get 60min again.....
if not os.path.exists("/etc/yt_block_state"):
write_state(state, pwd)
os.system(f"$PYTHON {__file__} guard")
state = read_state(pwd) # read the new state into memory, to write it before the next call
time.sleep(60*5)
if __name__ == "__main__":

View File

@@ -79,6 +79,8 @@
xclip
stalonetray
killall
vlc
chromium
# use signal from unstable, because the app itself says it would to update to be usable
self.inputs.nixpkgs-unstable.legacyPackages.x86_64-linux.signal-desktop

View File

@@ -50,7 +50,7 @@
Mouse {
label = "mouse";
bindings = <
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&trans &trans &trans &trans &kp PG_UP &trans &trans &trans &trans &trans &trans &trans
&trans &trans &mkp RCLK &mkp LCLK &to 0 &sl 4 &trans &kp N1 &trans &trans &trans &trans
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &to 0
&trans &trans &kp LEFT_ALT &kp RGUI &trans