From b0f13c07edeb04ec337e1894a4a5fc4d4d5f5408 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Czy=C5=BC?= Date: Mon, 8 Apr 2024 18:39:54 +0200 Subject: [PATCH] package and more dev software --- flake.lock | 144 ++++++++++++++++++++++++++++++++++++++--- flake.nix | 42 ++++++------ home.nix | 29 ++++++--- pkgs/papyrus.nix | 54 ++++++++++++++++ zion/configuration.nix | 33 +++++++--- 5 files changed, 251 insertions(+), 51 deletions(-) create mode 100644 pkgs/papyrus.nix diff --git a/flake.lock b/flake.lock index 0b058ef..8b7f092 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,38 @@ { "nodes": { + "flake-compat": { + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -21,19 +54,79 @@ "type": "github" } }, - "nixpkgs": { + "nix-alien": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "nix-filter": "nix-filter", + "nix-index-database": "nix-index-database", + "nixpkgs": [ + "nix-alien", + "nix-index-database", + "nixpkgs" + ] + }, "locked": { - "lastModified": 1712437997, - "narHash": "sha256-g0whLLwRvgO2FsyhY8fNk+TWenS3jg5UdlWL4uqgFeo=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "e38d7cb66ea4f7a0eb6681920615dfcc30fc2920", + "lastModified": 1710495228, + "narHash": "sha256-w0XM85Zo4mNqRLZDZMWUw0wv7LRoODKohCWIaVNnE94=", + "owner": "thiagokokada", + "repo": "nix-alien", + "rev": "75c0c2d5eb1fdd2c5187c49888cab40b060605fa", "type": "github" }, "original": { - "id": "nixpkgs", - "ref": "nixos-23.11", - "type": "indirect" + "owner": "thiagokokada", + "repo": "nix-alien", + "type": "github" + } + }, + "nix-filter": { + "locked": { + "lastModified": 1710156097, + "narHash": "sha256-1Wvk8UP7PXdf8bCCaEoMnOT1qe5/Duqgj+rL8sRQsSM=", + "owner": "numtide", + "repo": "nix-filter", + "rev": "3342559a24e85fc164b295c3444e8a139924675b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "nix-filter", + "type": "github" + } + }, + "nix-index-database": { + "inputs": { + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1710120787, + "narHash": "sha256-tlLuB73OCOKtU2j83bQzSYFyzjJo3rjpITZE5MoofG8=", + "owner": "nix-community", + "repo": "nix-index-database", + "rev": "e76ff2df6bfd2abe06abd8e7b9f217df941c1b07", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-index-database", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1709703039, + "narHash": "sha256-6hqgQ8OK6gsMu1VtcGKBxKQInRLHtzulDo9Z5jxHEFY=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "9df3e30ce24fd28c7b3e2de0d986769db5d6225d", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" } }, "nixpkgs-unstable": { @@ -51,12 +144,43 @@ "type": "indirect" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1712437997, + "narHash": "sha256-g0whLLwRvgO2FsyhY8fNk+TWenS3jg5UdlWL4uqgFeo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e38d7cb66ea4f7a0eb6681920615dfcc30fc2920", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-23.11", + "type": "indirect" + } + }, "root": { "inputs": { "home-manager": "home-manager", - "nixpkgs": "nixpkgs", + "nix-alien": "nix-alien", + "nixpkgs": "nixpkgs_2", "nixpkgs-unstable": "nixpkgs-unstable" } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index e91ebbf..87f5388 100644 --- a/flake.nix +++ b/flake.nix @@ -6,50 +6,44 @@ nixpkgs-unstable.url = "nixpkgs/nixos-unstable"; home-manager.url = "github:nix-community/home-manager/release-23.11"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; + nix-alien.url = "github:thiagokokada/nix-alien"; }; - outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, ...}: + outputs = inputs@{ self, nixpkgs, nixpkgs-unstable, home-manager, nix-alien, ...}: let lib = nixpkgs.lib; system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; pkgs-unstable = nixpkgs-unstable.legacyPackages.${system}; systemSettings = { - profile = "thor"; # select 'thor' or 'zion' + profile = "zion"; # select 'thor' or 'zion' }; in { nixosConfigurations = { - zion = lib.nixosSystem { - inherit system; - modules = [ - (./. + ("/" + systemSettings.profile) - + "/configuration.nix") - ]; - specialArgs = { - inherit pkgs-unstable; - }; - }; - thor = lib.nixosSystem { + system = lib.nixosSystem { inherit system; modules = [ (./. + ("/" + systemSettings.profile) + "/configuration.nix") + + home-manager.nixosModules.home-manager + { + home-manager = { + useGlobalPkgs = true; + useUserPackages = true; + + users.mike = import ./home.nix; + + extraSpecialArgs = { + inherit pkgs-unstable; + }; + }; + } ]; specialArgs = { inherit pkgs-unstable; }; }; }; - homeConfigurations = { - mike = home-manager.lib.homeManagerConfiguration { - inherit pkgs; - modules = [ - ./home.nix - ]; - extraSpecialArgs = { - inherit pkgs-unstable; - }; - }; - }; }; } diff --git a/home.nix b/home.nix index b11a730..91449d4 100644 --- a/home.nix +++ b/home.nix @@ -56,30 +56,41 @@ in { # The home.packages option allows you to install Nix packages into your # environment. home.packages = with pkgs; [ + # zsh stuff zsh zsh-autosuggestions zsh-powerlevel10k thefuck - kitty - rofi - git - eza - + # graphics tuxpaint krita - # spotify + # tools + kitty + rofi + git + eza + yt-dlp + ffmpeg + texliveFull + + # media + spotify vlc mpv - yt-dlp obs-studio - ffmpeg - # discord + # desktop + firefox + discord telegram-desktop + # gaming prismlauncher + steam + + # custom ]; # Home Manager is pretty good at managing dotfiles. The primary way to manage diff --git a/pkgs/papyrus.nix b/pkgs/papyrus.nix new file mode 100644 index 0000000..6db6b57 --- /dev/null +++ b/pkgs/papyrus.nix @@ -0,0 +1,54 @@ +with import {}; with pkgs; +stdenv.mkDerivation rec { + name = "papyrus"; + version = "6.6.0"; + buildInputs = [ pkgs.unzip + alsaLib + glibc + xlibs.libxcb + xlibs.libX11 + xlibs.libXcursor + xlibs.libXi + xlibs.libXrandr + libglvnd ]; + src = pkgs.fetchurl { + url = "https://download.eclipse.org/modeling/mdt/papyrus/rcp/2023-12/6.6.0/papyrus-2023-12-6.6.0-linux64.tar.gz"; + sha512 = "ab1f1c0192fa7791550ef284c221a5445e02a699f4a82ec9b08f2c4b1f894b387751c37a6c5109f7709afea265126210682a266adb00fb26768057c0321ba802"; + }; + # src = ./papyrus-2023-12-6.6.0-linux64.tar.gz; + sourceRoot = "."; + dontConfigure = true; + dontBuild = true; + installPhase = '' + mkdir -p $out/{bin,lib} + mv lib/* $out/lib/ + tar -xf $src -C $out/bin --strip-components=1 + ''; + dontPatchELF = true; + preFixup = let + libPath = lib.makeLibraryPath [ + alsaLib + glibc + xlibs.libxcb + xlibs.libX11.out + xlibs.libXcursor + xlibs.libXi + xlibs.libXrandr + libglvnd + ]; + in '' + rPath="${libPath}:$out/lib" + echo $rPath + patchelf \ + --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ + --set-rpath $rPath \ + $out/bin/robo-instructus-demo + ''; + # meta = with stdenv.lib; { + # homepage = "https://eclipse.dev/papyrus/index.php"; + # description = "Modeling environment"; + # license = licenses.free; + # platforms = platforms.linux; + # maintainers = [ "eRgo35" ]; + #}; +} diff --git a/zion/configuration.nix b/zion/configuration.nix index fa2aa5a..7e27150 100644 --- a/zion/configuration.nix +++ b/zion/configuration.nix @@ -133,10 +133,7 @@ isNormalUser = true; description = "Mike"; extraGroups = [ "networkmanager" "wheel" ]; - packages = [ - pkgs.discord - pkgs.spotify - ]; + packages = []; }; # List packages installed in system profile. To search, run: @@ -149,19 +146,29 @@ neofetch zsh pavucontrol - home-manager - firefox htop nerdfonts ntfs3g dosfstools woeusb + + python3 + + # cmake + # clang + # gcc + # gtest ]) ++ (with pkgs-unstable; [ neovim + + cmake + gcc + clang + gtest ]); # Some programs need SUID wrappers, can be configured further or are @@ -191,12 +198,22 @@ # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). system.stateVersion = "23.11"; # Did you read the comment? - nix.settings.experimental-features = ["nix-command" "flakes"]; + nix = { + settings = { + experimental-features = ["nix-command" "flakes"]; + substituters = [ + "https://nix-community.cachix.org" + "https://cache.nixos.org/" + ]; + trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; + }; + }; # Allow unfree packages nixpkgs.config = { allowUnfree = true; allowUnfreePredicate = (_: true); }; - }