From 90ac9d3478b526c90af963a761fa095887bdf100 Mon Sep 17 00:00:00 2001 From: Noratrieb <48135649+Noratrieb@users.noreply.github.com> Date: Fri, 28 Feb 2025 19:52:39 +0100 Subject: [PATCH] provide dev shell --- flake.nix | 15 ++------------- home-manager/laptop.nix | 34 ---------------------------------- nixos/configuration.nix | 6 ++++-- shells/c-env.nix | 4 ++++ 4 files changed, 10 insertions(+), 49 deletions(-) delete mode 100644 home-manager/laptop.nix create mode 100644 shells/c-env.nix diff --git a/flake.nix b/flake.nix index 2fb0f19..c56097d 100644 --- a/flake.nix +++ b/flake.nix @@ -43,19 +43,8 @@ }; }; - # Standalone home-manager configuration entrypoint - # Available through 'home-manager --flake .#nils@nixos' - homeConfigurations = { - "nilsh@LAPTOP-Nils" = home-manager.lib.homeManagerConfiguration { - pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance - extraSpecialArgs = { inherit inputs; }; # Pass flake inputs to our config - # > Our main home-manager configuration file < - modules = [ - ./home-manager/common.nix - ./home-manager/laptop.nix - ./home-manager/git.nix - ]; - }; + devShells.${"x86_64-linux"}.c-env = import ./shells/c-env.nix { + pkgs = import nixpkgs { system = "x86_64-linux"; }; }; }; } diff --git a/home-manager/laptop.nix b/home-manager/laptop.nix deleted file mode 100644 index 6353934..0000000 --- a/home-manager/laptop.nix +++ /dev/null @@ -1,34 +0,0 @@ -{ inputs, pkgs, ... }: { - nixpkgs = { - # You can add overlays here - overlays = [ - # If you want to use overlays exported from other flakes: - # neovim-nightly-overlay.overlays.default - # Or define it inline, for example: - # (final: prev: { - # hi = final.hello.overrideAttrs (oldAttrs: { - # patches = [ ./change-hello-to-hi.patch ]; - # }); - # }) - inputs.nur.overlays.default - ]; - # Configure your nixpkgs instance - config = { - allowUnfree = true; - # Workaround for https://github.com/nix-community/home-manager/issues/2942 - allowUnfreePredicate = (_: true); - }; - }; - - home.packages = import ./common-packages.nix { inherit pkgs; }; - - programs.fish.interactiveShellInit = '' - set fish_greeting # Disable greeting - . /home/nilsh/.nix-profile/etc/profile.d/nix.fish - ''; - - home = { - username = "nilsh"; - homeDirectory = "/home/nilsh"; - }; -} diff --git a/nixos/configuration.nix b/nixos/configuration.nix index f688b85..ec5d59e 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -89,7 +89,10 @@ in }; }; - boot.binfmt.emulatedSystems = [ "wasm32-wasi" "aarch64-linux" ]; + boot.binfmt = { + emulatedSystems = [ "wasm32-wasi" "aarch64-linux" ]; + preferStaticEmulators = true; # required to work with podman (apparently) + }; boot.kernelPackages = pkgs.linuxPackages_6_6; @@ -331,7 +334,6 @@ in enable = true; dockerCompat = true; defaultNetwork.settings.dns_enabled = true; - }; virtualbox.host = { enable = true; diff --git a/shells/c-env.nix b/shells/c-env.nix new file mode 100644 index 0000000..ea57cb0 --- /dev/null +++ b/shells/c-env.nix @@ -0,0 +1,4 @@ +{ pkgs }: pkgs.mkShell { + buildInputs = with pkgs; [ openssl zlib ]; + nativeBuildInputs = with pkgs; [ pkg-config cmake ]; +}