Compare commits

..

No commits in common. "f571e82c286a5dac2bd874a45c60c27fb2a4d66a" and "55f370c9d1be04e6cb14cb8689d1346524f52ccf" have entirely different histories.

7 changed files with 41 additions and 55 deletions

32
flake.lock generated
View File

@ -7,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1720042825, "lastModified": 1717527182,
"narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=", "narHash": "sha256-vWSkg6AMok1UUQiSYVdGMOXKD2cDFnajITiSi0Zjd1A=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073", "rev": "845a5c4c073f74105022533907703441e0464bc3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -24,7 +24,7 @@
"local-unstable": { "local-unstable": {
"locked": { "locked": {
"lastModified": 0, "lastModified": 0,
"narHash": "sha256-PARdSJzALMcRaXMHS/dZaJ+NDRQBvAhhPV4Bhlbh9gY=", "narHash": "sha256-jZsJ1OJKLBDPlEfP3JMm+268g82AJFG8uIbS77UCzLQ=",
"path": "/home/giulio/dev/nixpkgs", "path": "/home/giulio/dev/nixpkgs",
"type": "path" "type": "path"
}, },
@ -35,27 +35,27 @@
}, },
"nixos-unstable": { "nixos-unstable": {
"locked": { "locked": {
"lastModified": 1721163745, "lastModified": 1717244666,
"narHash": "sha256-YrMzZTjGJk+giMTT+FxOlumSj+8Ph84REHG0dvr0u1Y=", "narHash": "sha256-ulXScQazlg5gIPbxQ4ZmxuItAaVS/ECee/tUULu3W3Y=",
"owner": "NixOS", "owner": "r-ryantm",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "fd29c411f73776b4a10c917e17f25ad0a942173b", "rev": "239c8ca5385287a05ececa3a029354561b88b9f9",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "r-ryantm",
"ref": "master",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "239c8ca5385287a05ececa3a029354561b88b9f9",
"type": "github" "type": "github"
} }
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1721162132, "lastModified": 1717533996,
"narHash": "sha256-kH2unTqd/LlqG1NGbuUlRkDmXwCf80PNLNCjO3acQqI=", "narHash": "sha256-bBHBsdTaxfsldfvTzGGMyq3NCAd+mGjN5GsnL7/D5Kw=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "265595f550a572703d10a9db94a9ded793f21dfc", "rev": "ce4901de3c01fa0e8de0f92c39e5b585ff83e037",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -73,11 +73,11 @@
"utils": "utils" "utils": "utils"
}, },
"locked": { "locked": {
"lastModified": 1720463530, "lastModified": 1714473972,
"narHash": "sha256-oHFul4EmOfWVEuo7lbdjSZ6UAzRVOlYMyYj1H4ZTTLk=", "narHash": "sha256-J1o+D45PXCmPZHvGpA8mhzb7BolvBv0wWY8vYo+WMp8=",
"owner": "icewind1991", "owner": "icewind1991",
"repo": "nvidia-patch-nixos", "repo": "nvidia-patch-nixos",
"rev": "2877c51b2b40a51a04c432dced00ee280fc932d2", "rev": "0baf075bedfc84dc488000ae6c7cb4ed56967e2f",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -1,7 +1,7 @@
{ {
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/release-24.05"; nixpkgs.url = "github:NixOS/nixpkgs/release-24.05";
nixos-unstable.url = "github:NixOS/nixpkgs/master"; nixos-unstable.url = "github:r-ryantm/nixpkgs/239c8ca5385287a05ececa3a029354561b88b9f9";
local-unstable.url = "path:///home/giulio/dev/nixpkgs"; local-unstable.url = "path:///home/giulio/dev/nixpkgs";
home-manager = { home-manager = {
url = "github:nix-community/home-manager/release-24.05"; url = "github:nix-community/home-manager/release-24.05";
@ -25,29 +25,23 @@
inherit cudaSupport; inherit cudaSupport;
allowUnfree = true; allowUnfree = true;
}; };
extOverlays = [
(nvidia-patch.overlays.default)
];
in in
import nixpkgs rec { import nixpkgs rec {
inherit system config; inherit system config;
unstablePkgs = import nixos-unstable { unstablePkgs = import nixos-unstable {
inherit system config; inherit system config;
overlays = extOverlays;
}; };
localPkgs = import local-unstable { localPkgs = import local-unstable {
inherit system config; inherit system config;
overlays = extOverlays;
}; };
overlays = [ overlays = [
(final: prev: { inherit unstablePkgs; }) (final: prev: { inherit unstablePkgs; })
(final: prev: { inherit localPkgs; }) (final: prev: { inherit localPkgs; })
] ++ extOverlays; (nvidia-patch.overlays.default)
];
}; };
wrapUtils = { pkgs, system }: wrapUtils = { pkgs, system }:

View File

@ -84,6 +84,8 @@ in
"ip=${devices.architect.address}::${devices.router.address}:255.255.255.0::${interface}:off" "ip=${devices.architect.address}::${devices.router.address}:255.255.255.0::${interface}:off"
]; ];
kernelPackages = pkgs.linuxPackages;
kernel.sysctl = { "net.ipv4.ip_forward" = 1; }; kernel.sysctl = { "net.ipv4.ip_forward" = 1; };
loader = { loader = {
@ -109,6 +111,8 @@ in
address = devices.architect.address; address = devices.architect.address;
prefixLength = 24; prefixLength = 24;
}]; }];
# enp6s0.useDHCP = false;
# wlp4s0.useDHCP = false;
}; };
extraHosts = (generateDeviceStrings config.architect.networks.lan.devices) + '' extraHosts = (generateDeviceStrings config.architect.networks.lan.devices) + ''
@ -143,6 +147,8 @@ in
das_watchdog.enable = true; das_watchdog.enable = true;
zfs.autoScrub.enable = true; zfs.autoScrub.enable = true;
# TODO: put NVIDIA related in another module
# xserver.videoDrivers = [ "nvidia" ];
openssh = { openssh = {
enable = true; enable = true;

View File

@ -1,22 +1,12 @@
{ config, pkgs, ... }: { config, ... }:
let let
domain = "reddit.giugl.io"; domain = "reddit.giugl.io";
in in
{ {
systemd.services.libreddit.environment = {
REDLIB_ROBOTS_DISABLE_INDEXING = "on";
REDLIB_DEFAULT_THEME = "dracula";
REDLIB_DEFAULT_SHOW_NSFW = "on";
REDLIB_DEFAULT_BLUR_NSFW = "off";
REDLIB_DEFAULT_USE_HLS = "on";
REDLIB_DEFAULT_HIDE_HLS_NOTIFICATION = "on";
};
services.libreddit = { services.libreddit = {
enable = true; enable = true;
port = 9090; port = 9090;
package = pkgs.unstablePkgs.redlib;
}; };
architect.vhost.${domain} = { architect.vhost.${domain} = {

View File

@ -1,6 +1,9 @@
{ config, pkgs, ... }: { config, pkgs, ... }:
let let
# nvidia package to patch
nvidiaPackage = config.boot.kernelPackages.nvidiaPackages.latest;
user = "sunshine"; user = "sunshine";
resolutionScript = pkgs.writeTextFile { resolutionScript = pkgs.writeTextFile {
name = "sunshine-resolution-script"; name = "sunshine-resolution-script";
@ -17,15 +20,15 @@ let
mode_alias="''${width}x''${height}" mode_alias="''${width}x''${height}"
echo "xrandr setting new mode ''${mode_alias} ''${xrandr_mode_str}" echo "xrandr setting new mode ''${mode_alias} ''${xrandr_mode_str}"
${pkgs.xorg.xrandr}/bin/xrandr --rmmode ''${mode_alias} || echo error ${pkgs.xorg.xrandr}/bin/xrandr --rmmode ''${mode_alias}
${pkgs.xorg.xrandr}/bin/xrandr --newmode ''${mode_alias} ''${xrandr_mode_str} || echo error ${pkgs.xorg.xrandr}/bin/xrandr --newmode ''${mode_alias} ''${xrandr_mode_str}
${pkgs.xorg.xrandr}/bin/xrandr --addmode DP-0 ''${mode_alias} || echo error ${pkgs.xorg.xrandr}/bin/xrandr --addmode DP-0 ''${mode_alias}
# Apply new xrandr mode # Apply new xrandr mode
${pkgs.xorg.xrandr}/bin/xrandr --output DP-0 --primary --mode ''${mode_alias} --pos 0x0 --rotate normal || echo error ${pkgs.xorg.xrandr}/bin/xrandr --output DP-0 --primary --mode ''${mode_alias} --pos 0x0 --rotate normal
${config.boot.kernelPackages.nvidia_x11.settings}/bin/nvidia-settings -a 'SyncToVBlank=0' || echo error ${config.boot.kernelPackages.nvidia_x11.settings}/bin/nvidia-settings -a 'SyncToVBlank=0'
${config.boot.kernelPackages.nvidia_x11.bin}/bin/nvidia-smi --persistence-mode=ENABLED || echo error ${config.boot.kernelPackages.nvidia_x11.bin}/bin/nvidia-smi --persistence-mode=ENABLED
''; '';
executable = true; executable = true;
destination = "/bin/resolution.sh"; destination = "/bin/resolution.sh";
@ -80,6 +83,7 @@ in
powerManagement.finegrained = false; powerManagement.finegrained = false;
open = false; open = false;
nvidiaSettings = true; nvidiaSettings = true;
package = with pkgs; nvidia-patch.patch-nvenc (nvidia-patch.patch-fbc nvidiaPackage);
}; };
}; };

View File

@ -17,6 +17,7 @@
ydiff ydiff
nix-index nix-index
pipenv pipenv
python3
htop htop
glances glances
tree tree

View File

@ -10,14 +10,8 @@ let
yaml-language-server yaml-language-server
typescript-language-server typescript-language-server
bash-language-server bash-language-server
pyright
]; ];
py3 = actualPkgs.python3.withPackages (ps: with ps; [
python-lsp-server
python-lsp-ruff
pylsp-rope
rope
]);
in in
{ {
home = { home = {
@ -29,13 +23,14 @@ in
nil nil
texlab texlab
nixpkgs-fmt nixpkgs-fmt
ruff
ruff-lsp
mypy
shellcheck shellcheck
shfmt shfmt
gopls gopls
golangci-lint golangci-lint
golangci-lint-langserver golangci-lint-langserver
py3
ruff
gh gh
gofumpt gofumpt
] ++ nodePkgs; ] ++ nodePkgs;
@ -75,10 +70,6 @@ in
name = "nix" name = "nix"
formatter = { command = "nixpkgs-fmt" } formatter = { command = "nixpkgs-fmt" }
[language-server.pylsp.config.pylsp.plugins]
ruff = {enabled = true}
rope = {enabled = true}
[[language]] [[language]]
name = "bash" name = "bash"
formatter = { command = "shfmt", args = ["-s", "-ci", "-sr"] } formatter = { command = "shfmt", args = ["-s", "-ci", "-sr"] }