Compare commits

..

5 Commits

Author SHA1 Message Date
da23016c32 ayanami: Add to repo 2024-10-21 04:46:57 +02:00
caa71a5fb8 update flake.lock 2024-10-21 03:09:27 +02:00
6f5c107301 enable activitywatch 2024-10-21 03:03:52 +02:00
fd775a7765 enable nix-direnv 2024-10-21 03:03:52 +02:00
22ba543e74 soryu: add more ram 2024-10-11 04:22:36 +02:00
8 changed files with 391 additions and 40 deletions

49
flake.lock generated
View File

@ -106,11 +106,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1722885417, "lastModified": 1726861934,
"narHash": "sha256-QTkl20cFfb5qWs8CN0HfsIp/67+N8pTTLfVaeu/i398=", "narHash": "sha256-lOzPDwktd+pwszUTbpUdQg6iCzInS11fHLfkjmnvJrM=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "cb292a56b1aa6fa0f220f91d8106fd978fe1e13a", "rev": "546d921ec46735dbf876e36f4af8df1064d09432",
"revCount": 77, "revCount": 78,
"type": "git", "type": "git",
"url": "https://git.pvv.ntnu.no/Projects/grzegorz-clients" "url": "https://git.pvv.ntnu.no/Projects/grzegorz-clients"
}, },
@ -126,11 +126,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1720042825, "lastModified": 1726989464,
"narHash": "sha256-A0vrUB6x82/jvf17qPCpxaM+ulJnD8YZwH9Ci0BsAzE=", "narHash": "sha256-Vl+WVTJwutXkimwGprnEtXc/s/s8sMuXzqXaspIGlwM=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "e1391fb22e18a36f57e6999c7a9f966dc80ac073", "rev": "2f23fa308a7c067e52dfcc30a0758f47043ec176",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -229,13 +229,29 @@
"type": "github" "type": "github"
} }
}, },
"nixos-hardware": {
"locked": {
"lastModified": 1729455275,
"narHash": "sha256-THqzn/7um3oMHUEGXyq+1CJQE7EogwR3HjLMNOlhFBE=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "9fcf30fccf8435f6390efec4a4d38e69c2268a36",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "master",
"repo": "nixos-hardware",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1723688146, "lastModified": 1729181673,
"narHash": "sha256-sqLwJcHYeWLOeP/XoLwAtYjr01TISlkOfz+NG82pbdg=", "narHash": "sha256-LDiPhQ3l+fBjRATNtnuDZsBS7hqoBtPkKBkhpoBHv3I=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c3d4ac725177c030b1e289015989da2ad9d56af0", "rev": "4eb33fe664af7b41a4c446f87d20c9a0a6321fa3",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -263,11 +279,11 @@
}, },
"nur": { "nur": {
"locked": { "locked": {
"lastModified": 1723859387, "lastModified": 1729471037,
"narHash": "sha256-1a4zDw0wIH/7Yg0tvIusrkBAZlcQkpQBkqZtPYnBsCw=", "narHash": "sha256-aWGGu8XhKVR1FZ8nH8LVdvFwHX65byd8ZOJLi1gVCQA=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "b43ecc46a848d0107b17091e2cd74cb442e28885", "rev": "b1f97f5db3a6309affd80e412aee8cce747a1489",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -297,6 +313,7 @@
"greg-clients": "greg-clients", "greg-clients": "greg-clients",
"home-manager": "home-manager", "home-manager": "home-manager",
"nixgl": "nixgl", "nixgl": "nixgl",
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"nur": "nur", "nur": "nur",
"unstable": "unstable", "unstable": "unstable",
@ -327,11 +344,11 @@
}, },
"unstable": { "unstable": {
"locked": { "locked": {
"lastModified": 1723703277, "lastModified": 1729265718,
"narHash": "sha256-nk0RaUB5f68BwtXAYy3WAjqFhVKqIl9Z89RGycTa2vk=", "narHash": "sha256-4HQI+6LsO3kpWTYuVGIzhJs1cetFcwT7quWCk/6rqeo=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "8b908192e64224420e2d59dfd9b2e4309e154c5d", "rev": "ccc0c2126893dd20963580b6478d1a10a4512185",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -12,6 +12,8 @@
unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable"; unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
nur.url = "github:nix-community/NUR"; nur.url = "github:nix-community/NUR";
dan.url = "git+https://git.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";
@ -30,10 +32,24 @@
nixgl.inputs.nixpkgs.follows = "nixpkgs"; nixgl.inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = {self, nixpkgs, home-manager, unstable, nur, dan, nixgl, ... }@inputs: outputs = {self, nixpkgs, home-manager, unstable, nixos-hardware, nur, dan, nixgl, ... }@inputs:
let let
nixlib = unstable.lib; nixlib = unstable.lib;
defaultOverlays = [
(final: prev: {
unstable = import unstable {
inherit (prev) system config;
};
dan = dan.packages.${prev.system};
grzegorz-clients = inputs.greg-clients.packages.${prev.system}.grzegorz-clients;
gregctl = inputs.greg-clients.packages.${prev.system}.grzegorzctl;
# helix = inputs.helix.packages.${prev.system}.helix;
})
nur.overlay
nixgl.overlay
];
mkHome = mkHome =
{ machine { machine
, configuration ? self.nixosModules.home-manager.${machine} , configuration ? self.nixosModules.home-manager.${machine}
@ -41,7 +57,7 @@
, username ? "daniel" , username ? "daniel"
, homeDirectory ? "/home/${username}" , homeDirectory ? "/home/${username}"
, stateVersion ? "22.05" , stateVersion ? "22.05"
, extraSpecialArgs ? { inherit (self) overlays; } , extraSpecialArgs ? { inherit (self) defaultOverlays; }
}: }:
home-manager.lib.homeManagerConfiguration { home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
@ -67,6 +83,17 @@
// mkHomes [ "pvv-terminal" ] { username = "danio"; homeDirectory = "/home/pvv/d/danio"; }; // mkHomes [ "pvv-terminal" ] { username = "danio"; homeDirectory = "/home/pvv/d/danio"; };
nixosConfigurations = { nixosConfigurations = {
ayanami = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs;
};
modules = [
./hosts/ayanami/configuration.nix
nixos-hardware.nixosModules.lenovo-thinkpad-l480
];
};
soryu = nixpkgs.lib.nixosSystem { soryu = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = { specialArgs = {
@ -82,20 +109,6 @@
home-manager = nixlib.genAttrs allMachines (machine: import ./home/machines/${machine}.nix); home-manager = nixlib.genAttrs allMachines (machine: import ./home/machines/${machine}.nix);
}; };
overlays = [
(final: prev: {
unstable = import unstable {
inherit (prev) system config;
};
dan = dan.packages.${prev.system};
grzegorz-clients = inputs.greg-clients.packages.${prev.system}.grzegorz-clients;
gregctl = inputs.greg-clients.packages.${prev.system}.grzegorzctl;
# helix = inputs.helix.packages.${prev.system}.helix;
})
nur.overlay
nixgl.overlay
];
homeActivations = nixlib.genAttrs allMachines (machine: self.homeConfigurations.${machine}.activationPackage); homeActivations = nixlib.genAttrs allMachines (machine: self.homeConfigurations.${machine}.activationPackage);
apps.x86_64-linux = nixlib.genAttrs allMachines (machine: { apps.x86_64-linux = nixlib.genAttrs allMachines (machine: {
@ -103,9 +116,9 @@
program = "${self.homeActivations.${machine}}/activate"; program = "${self.homeActivations.${machine}}/activate";
}); });
hydraJobs = { # hydraJobs = {
laptop.x86_64-linux = self.homeActivations.laptop; # laptop.x86_64-linux = self.homeActivations.laptop;
desktop.x86_64-linux = self.homeActivations.desktop; # desktop.x86_64-linux = self.homeActivations.desktop;
}; # };
}; };
} }

View File

@ -24,5 +24,25 @@
duskTime = "21:30-22:30"; duskTime = "21:30-22:30";
}; };
services.activitywatch = {
enable = true;
watchers = {
aw-watcher-afk = {
package = pkgs.activitywatch;
settings = {
timeout = 300;
poll_time = 2;
};
};
aw-watcher-window = {
package = pkgs.activitywatch;
settings = {
poll_time = 1;
# exclude_title = true;
};
};
};
};
profiles.games.enable = true; profiles.games.enable = true;
} }

View File

@ -67,6 +67,7 @@ in
programs.direnv = { programs.direnv = {
enable = true; enable = true;
nix-direnv.enable = true;
}; };
programs.atuin = { programs.atuin = {

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

View File

@ -0,0 +1,241 @@
#n Edit this configuration file to define what should be installed on your system.
# Help is available in the configuration.nix(5) man page and in the NixOS manual
# (accessible by running nixos-help).
{ config, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
];
networking.hosts = {
# "10.10.111.103" = [ "snowbell.htb" "legacy.snowbell.htb" "management.snowbell.htb" ];
};
boot.binfmt.emulatedSystems = [ "aarch64-linux" ];
virtualisation.podman.enable = true;
virtualisation.libvirtd.enable = true;
programs.dconf.enable = true;
programs.wireshark.enable = true;
programs.wireshark.package = pkgs.wireshark;
# services.mysql.enable = true;
# services.mysql.package = pkgs.mariadb;
# services.mysql.settings.mysqld = {
# bind-address = "127.0.0.1";
# port = 3306;
# };
# services.mysql.ensureUsers = [
# {
# name = "daniel";
# ensurePermissions = {
# "lab1.*" = "ALL PRIVILEGES";
# "lab2.*" = "ALL PRIVILEGES";
# "lab3.*" = "ALL PRIVILEGES";
# "lab4.*" = "ALL PRIVILEGES";
# "lab5.*" = "ALL PRIVILEGES";
# };
# }
# ];
# services.create_ap.enable = false;
# services.create_ap.settings = {
# INTERNET_IFACE = "enp0s31f6";
# PASSPHRASE = "12345678";
# SSID = "DOTA2ERBEST";
# WIFI_IFACE = "wlp5s0";
# MAC_FILTER = 0;
# HIDDEN = 0;
# };
boot.kernelModules = [ "v4l2loopback" ];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "ayanami"; # Define your hostname.
networking.networkmanager.enable = true;
hardware.bluetooth.enable = true;
services.blueman.enable = true;
# Set your time zone.
time.timeZone = "Europe/Oslo";
services.tailscale.enable = true;
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config
# replicates the default behaviour.
networking.useDHCP = false;
networking.interfaces.enp0s31f6.useDHCP = false;
networking.interfaces.wlp5s0.useDHCP = false;
services.avahi.enable = false;
# services.atftpd = {
# enable = false;
# };
# Select internationalisation properties.
i18n.supportedLocales = [ "en_US.UTF-8/UTF-8" "nb_NO.UTF-8/UTF-8" ];
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_TIME = "nb_NO.UTF-8";
LC_PAPER = "nb_NO.UTF-8";
LC_NAME = "nb_NO.UTF-8";
LC_ADDRESS = "nb_NO.UTF-8";
LC_TELEPHONE = "nb_NO.UTF-8";
LC_MEASUREMENT = "nb_NO.UTF-8";
LC_IDENTIFICATION = "nb_NO.UTF-8";
};
console = {
font = "Lat2-Terminus16";
keyMap = "no-latin1";
};
services.xserver.displayManager.lightdm.enable = true;
services.displayManager.defaultSession = "xsession";
# Enable the X11 windowing system.
services.xserver.enable = true;
services.xserver.displayManager = {
session = [
{
manage = "desktop";
name = "xsession";
start = "exec $HOME/.xsession";
}
];
};
# Disable cups we will just not print anything :))
services.printing.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
};
hardware.opengl.driSupport32Bit = true;
hardware.opengl.extraPackages = with pkgs; [ libva ];
# Enable touchpad support (enabled default in most desktopManager).
services.libinput.enable = true;
services.xserver.xkb.layout = "no";
programs.zsh.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.daniel = {
isNormalUser = true;
shell = pkgs.zsh;
extraGroups = [ "wheel" "networkmanager" "wireshark" "libvirtd" ];
};
environment.systemPackages = with pkgs; [
vim
git
wget
virt-manager
podman-compose
];
services.dbus.packages = with pkgs; [ pkgs.dconf ];
services.openssh.enable = true;
services.openssh.openFirewall = false;
networking.firewall.interfaces."tailscale0" = let
all = { from = 0; to = 65535; };
in {
allowedUDPPortRanges = [ all ];
allowedTCPPortRanges = [ all ];
};
# Open ports in the firewall.
networking.firewall.allowedTCPPorts = [ 69 8010 9090 ];
networking.firewall.allowedUDPPorts = [ 69 8010 9090 ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
nix.settings.trusted-users = [ "daniel" ];
nix.buildMachines = [
# { hostName = "bob.pvv.ntnu.no";
# system = "x86_64-linux";
# maxJobs = 12;
# supportedFeatures = [ "big-parallel" ];
# speedFactor = 129270;
# }
{ hostName = "bolle.pbsds.net";
system = "x86_64-linux";
maxJobs = 6;
speedFactor = 12857;
}
{ hostName = "garp.pbsds.net";
system = "x86_64-linux";
maxJobs = 4;
# i7-6700
speedFactor = 8088;
}
{ hostName = "lilith";
system = "x86_64-linux";
# if the builder supports building for multiple architectures,
# replace the previous line by, e.g.,
# systems = ["x86_64-linux" "aarch64-linux"];
maxJobs = 6;
#speedFactor = 13199;
speedFactor = 6000;
supportedFeatures = [ ];
mandatoryFeatures = [ ];
}
{ hostName = "desktop";
system = "x86_64-linux";
maxJobs = 4;
#speedFactor = 8066;
speedFactor = 4000;
supportedFeatures = [ ];
mandatoryFeatures = [ ];
}
# { hostName = "sachiel";
# system = "x86_64-linux";
# maxJobs = 1;
# #speedfactor =
# }
# {
# hostName = "isvegg.pvv.ntnu.no";
# system = "x86_64-linux";
# maxJobs = 4;
# speedFactor = 4961;
# supportedFeatures = [ "big-parallel" ];
# mandatoryFeatures = [ ];
# }
];
nix.distributedBuilds = true;
nix.extraOptions = ''
builders-use-substitutes = true
experimental-features = nix-command flakes impure-derivations ca-derivations
'';
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. Its perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.11"; # Did you read the comment?
}

View File

@ -0,0 +1,59 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/276d0801-34f7-4d40-aa24-bfc43ea4ff51";
fsType = "btrfs";
options = [ "subvol=root" ];
};
boot.initrd.luks.devices."enc".device = "/dev/disk/by-uuid/27c2e6ae-d9ec-4bbd-9ebe-6ec2e63dd139";
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/276d0801-34f7-4d40-aa24-bfc43ea4ff51";
fsType = "btrfs";
options = [ "subvol=home" ];
};
fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/276d0801-34f7-4d40-aa24-bfc43ea4ff51";
fsType = "btrfs";
options = [ "subvol=nix" ];
};
fileSystems."/persist" =
{ device = "/dev/disk/by-uuid/276d0801-34f7-4d40-aa24-bfc43ea4ff51";
fsType = "btrfs";
options = [ "subvol=persist" ];
};
fileSystems."/var/log" =
{ device = "/dev/disk/by-uuid/276d0801-34f7-4d40-aa24-bfc43ea4ff51";
fsType = "btrfs";
options = [ "subvol=log" ];
neededForBoot = true;
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/503B-1BC9";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/28c04c57-b026-471f-a7bf-366cbc102b78"; }
];
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@ -15,8 +15,8 @@
Bind = [ Bind = [
"/dev/dri:/dev/dri" "/dev/dri:/dev/dri"
"/dev/kfd:/dev/kfd" "/dev/kfd:/dev/kfd"
"/mnt/human/llama:/llama" "/mnt/human/llama:/llama:idmap"
"/mnt/human/sd:/sd" "/mnt/human/sd:/sd:idmap"
]; ];
}; };
}; };
@ -27,8 +27,8 @@
}; };
serviceConfig = { serviceConfig = {
CPUQuota = "300%"; CPUQuota = "300%";
MemoryHigh = "14G"; MemoryHigh = "29G";
MemoryMax = "15G"; MemoryMax = "30G";
MemorySwapMax = "25G"; MemorySwapMax = "25G";
ExecStart = "systemd-nspawn --quiet --keep-unit --boot --link-journal=try-guest --network-veth -U --settings=override --machine=%i -D /mnt/human/machines/ubuntu-ai"; ExecStart = "systemd-nspawn --quiet --keep-unit --boot --link-journal=try-guest --network-veth -U --settings=override --machine=%i -D /mnt/human/machines/ubuntu-ai";
}; };