My first devshell

This commit is contained in:
Benson Chu 2024-07-14 14:14:08 -05:00
parent ab9a08d510
commit 67e731c54b
4 changed files with 54 additions and 31 deletions

View file

@ -22,6 +22,18 @@
valgrind
nodejs_21
# mps.overrideAttrs (old: {
# pname = "mps";
# version = "1.118.0";
# src = fetchFromGitHub {
# owner = "Ravenbrook";
# repo = "mps";
# rev = "refs/tags/release-${version}";
# hash = "sha256-3ql3jWLccgnQHKf23B1en+nJ9rxqmHcWd7aBr93YER0=";
# };
# })
];
boot.kernel.sysctl."kernel.perf_event_paranoid" = 1;

9
common/overlays.nix Normal file
View file

@ -0,0 +1,9 @@
inputs:
[
(final: prev: {
mps-debug = prev.mps.overrideAttrs (old: {
pname = old.pname + "-debug";
env.NIX_CFLAGS_COMPILE = old.env.NIX_CFLAGS_COMPILE + " -g -DCONFIG_VAR_COOL";
});
})
]

View file

@ -1,22 +1,5 @@
{
"nodes": {
"bashcfg-input": {
"flake": false,
"locked": {
"lastModified": 1704461224,
"narHash": "sha256-lbMvlgLwAgAytz/mmOFMYJu40bKGgtYGHWVG9T1Ypos=",
"owner": "pestctrl",
"repo": "bash-config",
"rev": "015ac81d3ee483ff0b3f13c5e9c912cf428dd745",
"type": "github"
},
"original": {
"owner": "pestctrl",
"ref": "master",
"repo": "bash-config",
"type": "github"
}
},
"emacs-overlay": {
"inputs": {
"flake-utils": "flake-utils",
@ -129,7 +112,6 @@
},
"root": {
"inputs": {
"bashcfg-input": "bashcfg-input",
"emacs-overlay": "emacs-overlay",
"home-manager": "home-manager",
"nixos-hardware": "nixos-hardware",

View file

@ -3,26 +3,26 @@
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
update.url = "github:nixos/nixpkgs/nixos-23.11";
unstable.url = "github:nixos/nixpkgs/nixos-unstable";
emacs-overlay = {
url = "github:nix-community/emacs-overlay/master";
inputs.nixpkgs.follows = "nixpkgs";
};
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
home-manager = {
url = "github:nix-community/home-manager/release-23.11";
inputs.nixpkgs.follows = "nixpkgs";
};
bashcfg-input = {
url = "github:pestctrl/bash-config/master";
flake = false;
emacs-overlay = {
url = "github:nix-community/emacs-overlay/master";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, update, unstable, home-manager, nixos-hardware, ... }@inputs:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
pkgs = import nixpkgs {
inherit system;
overlays = import ./common/overlays.nix inputs;
};
mkSystem = h: {
"${h}" = nixpkgs.lib.nixosSystem {
inherit system;
@ -43,9 +43,11 @@
in {
nixosConfigurations =
(nixpkgs.lib.foldr (a: b: a // b) {}
(map mkSystem ["NixDawn" "NixFrame"])) // {
NixGate = nixpkgs.lib.nixosSystem {
(pkgs.lib.foldr (a: b: a // b) {}
(map mkSystem ["NixDawn" "NixFrame"]))
// {
NixGate = pkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs; };
modules = [
@ -54,7 +56,7 @@
];
};
NixSentinel = nixpkgs.lib.nixosSystem {
NixSentinel = pkgs.lib.nixosSystem {
inherit system;
specialArgs = { inherit inputs; };
modules = [
@ -63,12 +65,30 @@
];
};
# nixosConfigurations.LenoNix = nixpkgs.lib.nixosSystem {
# LenoNix = nixpkgs.lib.nixosSystem {
# system = "x86_64-linux";
# modules = [ ./hosts/NixFrame/configuration.nix ];
# };
};
devShells."${system}" = {
default = pkgs.mkShell {
# packages = with pkgs; [mps-debug];
# nativeBuildInputs = with pkgs; [ mps-debug ] ++ pkgs.emacs.nativeBuildInputs;
# buildInputs = pkgs.emacs.buildInputs;
packages = with pkgs; [ mps-debug ];
inputsFrom = with pkgs; [ emacs ];
shellHook = ''
export MPS_LIB="${pkgs.mps-debug}/lib"
export MPS_INC="${pkgs.mps-debug}/include"
echo "MPS debug environment!"
echo "MPS_LIB = $MPS_LIB"
echo "MPS_INC = $MPS_INC"
'';
};
};
homeConfigurations."benson" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = { inherit inputs; };