diff --git a/devEnvironments/oasys.nix b/devEnvironments/oasys.nix new file mode 100644 index 0000000..6c7afc1 --- /dev/null +++ b/devEnvironments/oasys.nix @@ -0,0 +1,36 @@ +{ pkgs ? import { + config = { + allowUnfree = true; + cudaSupport = true; + }; +}}: pkgs.mkShell { + name = "oasys"; + + buildInputs = with pkgs; [ + python311 + python311Packages.virtualenv + python311Packages.pip + python311Packages.scipy + python311Packages.torch + python311Packages.cython + + git gitRepo gnupg autoconf curl + procps gnumake util-linux m4 gperf unzip + cudatoolkit linuxPackages.nvidia_x11 + libGLU libGL + xorg.libXi xorg.libXmu freeglut + xorg.libXext xorg.libX11 xorg.libXv xorg.libXrandr zlib + ncurses5 stdenv.cc binutils + ]; + + shell = pkgs.zsh; + + shellHook = '' + export CUDA_PATH=${pkgs.cudaPackages.cudatoolkit} + export LD_LIBRARY_PATH=${pkgs.linuxPackages.nvidia_x11}/lib:${pkgs.ncurses5}/lib + export LD_LIBRARY_PATH=/run/opengl-drivers/lib:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$NIX_LD_LIBRARY_PATH; + export EXTRA_LDFLAGS="-L/lib -L${pkgs.linuxPackages.nvidia_x11}/lib" + export EXTRA_CCFLAGS="-I/usr/include" + ''; +} diff --git a/devEnvironments/raman.nix b/devEnvironments/raman.nix new file mode 100644 index 0000000..83bd665 --- /dev/null +++ b/devEnvironments/raman.nix @@ -0,0 +1,22 @@ +{ pkgs ? import { + config = { + allowUnfree = true; + cudaSupport = true; + }; +}}: pkgs.mkShell { + name = "raman"; + + nativeBuildInputs = with pkgs; [ + gtk3 + fiji + ]; + + shell = pkgs.zsh; + + runScript = "zsh"; + + GSETTINGS_SCHEMA_DIR="${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}/glib-2.0/schemas"; + + shellHook = '' + ''; +} diff --git a/flake.lock b/flake.lock index bfa6457..7b7aabc 100644 --- a/flake.lock +++ b/flake.lock @@ -40,11 +40,11 @@ ] }, "locked": { - "lastModified": 1723405438, - "narHash": "sha256-bpmC2m7OhlDvqgQZdZ2jBLyeIkq/Jld3X4bqRAxBSp8=", + "lastModified": 1723920171, + "narHash": "sha256-dVCMrAe+D/5S91erhwQj2DSzHOVzAanWqoy+vPWB9DY=", "owner": "hyprwm", "repo": "aquamarine", - "rev": "9312aa28271c91e5d67ecb9def527b2bbcff0e66", + "rev": "71d49670fe246cdaff4860b0effba0ab9f163b72", "type": "github" }, "original": { @@ -167,6 +167,24 @@ "type": "github" } }, + "devshell": { + "inputs": { + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1722113426, + "narHash": "sha256-Yo/3loq572A8Su6aY5GP56knpuKYRvM2a1meP9oJZCw=", + "owner": "numtide", + "repo": "devshell", + "rev": "67cce7359e4cd3c45296fb4aaf6a19e2a9c757ae", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "devshell", + "type": "github" + } + }, "disko": { "inputs": { "nixpkgs": [ @@ -174,11 +192,11 @@ ] }, "locked": { - "lastModified": 1723685519, - "narHash": "sha256-GkXQIoZmW2zCPp1YFtAYGg/xHNyFH/Mgm79lcs81rq0=", + "lastModified": 1723996216, + "narHash": "sha256-QNykxbGaHF3ANP369TT+VEBHlHufwY0SQk1SvUz5RcE=", "owner": "nix-community", "repo": "disko", - "rev": "276a0d055a720691912c6a34abb724e395c8e38a", + "rev": "fd43891af43916918eabdd498eeb24788d666079", "type": "github" }, "original": { @@ -206,7 +224,7 @@ "eww": { "inputs": { "flake-compat": "flake-compat", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "rust-overlay": "rust-overlay" }, "locked": { @@ -240,22 +258,6 @@ } }, "flake-compat_2": { - "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_3": { "flake": false, "locked": { "lastModified": 1673956053, @@ -362,27 +364,6 @@ "type": "github" } }, - "gitignore": { - "inputs": { - "nixpkgs": [ - "pre-commit-hooks", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1709087332, - "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, "gnome-shell": { "flake": false, "locked": { @@ -407,11 +388,11 @@ ] }, "locked": { - "lastModified": 1723399884, - "narHash": "sha256-97wn0ihhGqfMb8WcUgzzkM/TuAxce2Gd20A8oiruju4=", + "lastModified": 1723986931, + "narHash": "sha256-Fy+KEvDQ+Hc8lJAV3t6leXhZJ2ncU5/esxkgt3b8DEY=", "owner": "nix-community", "repo": "home-manager", - "rev": "086f619dd991a4d355c07837448244029fc2d9ab", + "rev": "2598861031b78aadb4da7269df7ca9ddfc3e1671", "type": "github" }, "original": { @@ -477,16 +458,16 @@ "hyprlang": "hyprlang", "hyprutils": "hyprutils", "hyprwayland-scanner": "hyprwayland-scanner", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_4", "systems": "systems_3", "xdph": "xdph" }, "locked": { - "lastModified": 1723738578, - "narHash": "sha256-TLkmHk6xWEUGpLci1QNyWRC7VFqocgBat2gl1gVXpY4=", + "lastModified": 1724005153, + "narHash": "sha256-DxvcCVsQd5wjypD4MXG33GMQuMftafzXta4mYDOJPqs=", "ref": "refs/heads/main", - "rev": "12d9901472c6f9128fa8b16c25b3a879d1859e60", - "revCount": 5095, + "rev": "50348a3ddbb6bc3367300c9bba2ff682e4a356e3", + "revCount": 5105, "submodules": true, "type": "git", "url": "https://github.com/hyprwm/Hyprland" @@ -712,11 +693,11 @@ "nixos-config": { "flake": false, "locked": { - "lastModified": 1723778822, - "narHash": "sha256-9PZ6q8hBN3is5i8ydF1EzsTLg06DpUZO2abfe6RBnIM=", + "lastModified": 1723820869, + "narHash": "sha256-ihPzPsiI6hJzQXX5NxYQeIcv3vrUQBk1q+Q3q0GJvD4=", "owner": "C4theBomb", "repo": "nixos-config", - "rev": "c4d99b320b903ef43bc9db0691ac14cba84c8449", + "rev": "02f1af080ff4dfedb5bddfc4a307c2e5ff21b33f", "type": "github" }, "original": { @@ -754,22 +735,6 @@ } }, "nixpkgs-stable": { - "locked": { - "lastModified": 1720386169, - "narHash": "sha256-NGKVY4PjzwAa4upkGtAMz1npHGoRzWotlSnVlqI40mo=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "194846768975b7ad2c4988bdb82572c00222c0d7", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-24.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-stable_2": { "locked": { "lastModified": 1721524707, "narHash": "sha256-5NctRsoE54N86nWd0psae70YSLfrOek3Kv1e8KoXe/0=", @@ -786,6 +751,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1722073938, + "narHash": "sha256-OpX0StkL8vpXyWOGUD6G+MA26wAXK6SpT94kLJXo6B4=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e36e9f57337d0ff0cf77aceb58af4c805472bfae", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1709038661, "narHash": "sha256-Ys611iT6pChGv954aa4f8oKoDKJG3IXjJjPhnj6uaLY=", @@ -801,22 +782,6 @@ "type": "github" } }, - "nixpkgs_3": { - "locked": { - "lastModified": 1723637854, - "narHash": "sha256-med8+5DSWa2UnOqtdICndjDAEjxr5D7zaIiK4pn0Q7c=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "c3aa7b8938b17aebd2deecf7be0636000d62a2b9", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, "nixpkgs_4": { "locked": { "lastModified": 1723637854, @@ -835,16 +800,16 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1719082008, - "narHash": "sha256-jHJSUH619zBQ6WdC21fFAlDxHErKVDJ5fpN0Hgx4sjs=", + "lastModified": 1723637854, + "narHash": "sha256-med8+5DSWa2UnOqtdICndjDAEjxr5D7zaIiK4pn0Q7c=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9693852a2070b398ee123a329e68f0dab5526681", + "rev": "c3aa7b8938b17aebd2deecf7be0636000d62a2b9", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-unstable", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } @@ -897,30 +862,10 @@ "type": "github" } }, - "pre-commit-hooks": { - "inputs": { - "flake-compat": "flake-compat_2", - "gitignore": "gitignore", - "nixpkgs": "nixpkgs_5", - "nixpkgs-stable": "nixpkgs-stable" - }, - "locked": { - "lastModified": 1723202784, - "narHash": "sha256-qbhjc/NEGaDbyy0ucycubq4N3//gDFFH3DOmp1D3u1Q=", - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "rev": "c7012d0c18567c889b948781bc74a501e92275d1", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "pre-commit-hooks.nix", - "type": "github" - } - }, "root": { "inputs": { "anyrun": "anyrun", + "devshell": "devshell", "disko": "disko", "dotfiles": "dotfiles", "eww": "eww", @@ -930,8 +875,7 @@ "impermanence": "impermanence", "neovim-config": "neovim-config", "nixos-config": "nixos-config", - "nixpkgs": "nixpkgs_4", - "pre-commit-hooks": "pre-commit-hooks", + "nixpkgs": "nixpkgs_5", "sops-nix": "sops-nix", "stylix": "stylix", "xdg-portal-hyprland": "xdg-portal-hyprland", @@ -987,7 +931,7 @@ "nixpkgs": [ "nixpkgs" ], - "nixpkgs-stable": "nixpkgs-stable_2" + "nixpkgs-stable": "nixpkgs-stable" }, "locked": { "lastModified": 1723501126, @@ -1012,17 +956,17 @@ "base16-kitty": "base16-kitty", "base16-tmux": "base16-tmux", "base16-vim": "base16-vim", - "flake-compat": "flake-compat_3", + "flake-compat": "flake-compat_2", "gnome-shell": "gnome-shell", "home-manager": "home-manager_2", "nixpkgs": "nixpkgs_6" }, "locked": { - "lastModified": 1722946882, - "narHash": "sha256-mxtnMye8gs82tdQbVC+g6v3aPOZlH150f9WyntHIkTg=", + "lastModified": 1723834469, + "narHash": "sha256-PkJTr9DWBQcR5Ru1fJpG80dtw0MLSxAZlKnhHHFAGIA=", "owner": "danth", "repo": "stylix", - "rev": "5853f1a8bd072f2ebabfc3de3973084353cf6f1e", + "rev": "6858d08ed012bc6491cc92c13142104e56badf31", "type": "github" }, "original": { @@ -1179,11 +1123,11 @@ "rust-overlay": "rust-overlay_2" }, "locked": { - "lastModified": 1723732776, - "narHash": "sha256-tK2dm+WIEJGSq/PbRyagt7x43nd/o1HxP8HMj23HfnQ=", + "lastModified": 1723996277, + "narHash": "sha256-nx5Y+zHDf8EDJSbyp9hJK2gJMyUncfnoaFLmbHQ9fEw=", "owner": "sxyazi", "repo": "yazi", - "rev": "4112bf451faa995f34763b2de3efb5aa715d107a", + "rev": "0f106b591c7be48508821313a6b2a9566f8dca62", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 4e59f4a..c63b38d 100644 --- a/flake.nix +++ b/flake.nix @@ -1,57 +1,36 @@ { description = "snowflake"; - outputs = inputs: inputs.flake-parts.lib.mkFlake { - inherit inputs; - } { + outputs = inputs@{ flake-parts, ... }: flake-parts.lib.mkFlake { inherit inputs; } { imports = [ - inputs.pre-commit-hooks.flakeModule + inputs.devshell.flakeModule + ./hosts ./home/profiles ]; + systems = ["x86_64-linux"]; - perSystem = { config, pkgs, ... }: { - pre-commit = { - check.enable = true; - settings = { - excludes = ["flake.lock"]; - hooks = { - stylua.enable = true; - statix.enable = true; - alejandra.enable = true; - deadnix = { - enable = true; - excludes = ["overlays.nix"]; - }; - prettier = { - enable = true; - files = "\\.(js|ts|md|json)$"; - settings = { - trailing-comma = "none"; - }; - }; - }; - }; + + perSystem = { config, ... }: + let + system = "x86_64-linux"; + pkgs = import inputs.nixpkgs { + inherit system; + config = { allowUnfree = true; cudaSupport = true; }; }; - devShells.default = pkgs.mkShell { - name = "snowflake"; - shellHook = config.pre-commit.installationScript; - packages = with pkgs; [ - git - sops - alejandra - yaml-language-server - lua-language-server - ]; + in + { + devShells = { + oasys = (import ./devEnvironments/oasys.nix { inherit pkgs; }); + raman = (import ./devEnvironments/raman.nix { inherit pkgs; }); }; - formatter = pkgs.alejandra; }; }; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-parts.url = "github:hercules-ci/flake-parts"; - pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; + devshell.url = "github:numtide/devshell"; hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1"; xdg-portal-hyprland.url = "github:hyprwm/xdg-desktop-portal-hyprland"; diff --git a/home/default.nix b/home/default.nix index 447231a..ae1917a 100644 --- a/home/default.nix +++ b/home/default.nix @@ -1,10 +1,21 @@ -{ pkgs, ... }: { +{ pkgs, inputs, ... }: { programs.home-manager.enable = true; nixpkgs.config.allowUnfree = true; - home.packages = [ - (import ./scripts/get-music-cover.nix { inherit pkgs; }) - (import ./scripts/scratchpad.nix { inherit pkgs; }) + imports = [ + ./programs + ./wayland + ./scripts + + inputs.sops-nix.homeManagerModules.sops + ]; + + home.packages = with pkgs; [ + curl + wget + xclip + sops + git-crypt ]; } diff --git a/home/profiles/arisu/default.nix b/home/profiles/arisu/default.nix index 0090d0a..8525862 100644 --- a/home/profiles/arisu/default.nix +++ b/home/profiles/arisu/default.nix @@ -1,23 +1,10 @@ { inputs, pkgs, ... }: { imports = [ ./stylix.nix - - ../../programs - ../../wayland - - inputs.sops-nix.homeManagerModules.sops - ]; - - home.packages = with pkgs; [ - curl - wget - xclip - sops - git-crypt ]; sops = { - defaultSopsFile = ../../../secrets/sops/secrets.yaml; + defaultSopsFile = inputs.dotfiles + "/secrets/sops/secrets.yaml" ; defaultSopsFormat = "yaml"; age = { keyFile = "/home/c4patino/.config/sops/age/keys.txt"; @@ -25,7 +12,6 @@ }; secrets = { - github-auth = {}; }; }; diff --git a/home/profiles/default.nix b/home/profiles/default.nix index cb80a0d..5d222e3 100644 --- a/home/profiles/default.nix +++ b/home/profiles/default.nix @@ -17,8 +17,6 @@ let ]; }; - pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux; - secrets = builtins.fromJSON (builtins.readFile "${self}/secrets/crypt/secrets.json"); in { @@ -28,13 +26,14 @@ in homeConfigurations = { "c4patino@arisu" = inputs.home-manager.lib.homeManagerConfiguration { modules = homeImports."c4patino@arisu"; - inherit pkgs extraSpecialArgs; + pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux; + inherit extraSpecialArgs; }; "c4patino@kokoro" = inputs.home-manager.lib.homeManagerConfiguration { modules = homeImports."c4patino@kokoro"; - inherit pkgs extraSpecialArgs; + pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux; + inherit extraSpecialArgs; }; }; }; - } diff --git a/home/profiles/hikari/default.nix b/home/profiles/hikari/default.nix index 6790712..382fe54 100644 --- a/home/profiles/hikari/default.nix +++ b/home/profiles/hikari/default.nix @@ -1,35 +1,10 @@ { inputs, pkgs, ... }: { imports = [ ./stylix.nix - - ../../programs - ../../wayland - - inputs.sops-nix.homeManagerModules.sops - ]; - - home.packages = with pkgs; [ - curl - wget - xclip - sops - git-crypt ]; home.file."dotfiles/".source = inputs.nixos-config; - sops = { - defaultSopsFile = inputs.dotfiles + "/secrets/sops/secrets.yaml" ; - defaultSopsFormat = "yaml"; - age = { - keyFile = "/home/nixos/.config/sops/age/keys.txt"; - generateKey = true; - }; - - secrets = { - }; - }; - home = { username = "nixos"; homeDirectory = "/home/nixos"; diff --git a/home/profiles/kokoro/default.nix b/home/profiles/kokoro/default.nix index 557f1de..973ab22 100644 --- a/home/profiles/kokoro/default.nix +++ b/home/profiles/kokoro/default.nix @@ -1,19 +1,6 @@ { inputs, pkgs, ... }: { imports = [ ./stylix.nix - - ../../programs - ../../wayland - - inputs.sops-nix.homeManagerModules.sops - ]; - - home.packages = with pkgs; [ - curl - wget - xclip - sops - git-crypt ]; sops = { diff --git a/home/programs/languages.nix b/home/programs/languages.nix index 481ffdd..b16186e 100644 --- a/home/programs/languages.nix +++ b/home/programs/languages.nix @@ -18,5 +18,10 @@ ]; programs.java.enable = true; + programs.direnv = { + enable = true; + enableZshIntegration = true; + nix-direnv.enable = true; + }; }; } diff --git a/home/scripts/default.nix b/home/scripts/default.nix new file mode 100644 index 0000000..fc3b94e --- /dev/null +++ b/home/scripts/default.nix @@ -0,0 +1,6 @@ +{ pkgs, ... }: { + home.packages = [ + (import ./get-music-cover.nix { inherit pkgs; }) + (import ./scratchpad.nix { inherit pkgs; }) + ]; +} diff --git a/hosts/default.nix b/hosts/default.nix index 86ed1bd..015d365 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -7,10 +7,12 @@ { arisu = nixosSystem { inherit specialArgs; + system = "x86_64-linux"; modules = [ ./arisu ]; }; kokoro = nixosSystem { inherit specialArgs; + system = "x86_64-linux"; modules = [ ./kokoro ]; }; hikari = nixosSystem {