add devshell to flake
This commit is contained in:
61
flake.lock
generated
61
flake.lock
generated
@ -1,10 +1,29 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"emacs-overlay": {
|
"devshell": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
},
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1658746384,
|
||||||
|
"narHash": "sha256-CCJcoMOcXyZFrV1ag4XMTpAPjLWb4Anbv+ktXFI1ry0=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "devshell",
|
||||||
|
"rev": "0ffc7937bb5e8141af03d462b468bd071eb18e1b",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "devshell",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"emacs-overlay": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils_2",
|
||||||
|
"nixpkgs": "nixpkgs_2"
|
||||||
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1658833746,
|
"lastModified": 1658833746,
|
||||||
"narHash": "sha256-bm/FXx7lH8xaM1excP4SLexVBdaTKE5tZS8PyuibnsA=",
|
"narHash": "sha256-bm/FXx7lH8xaM1excP4SLexVBdaTKE5tZS8PyuibnsA=",
|
||||||
@ -20,6 +39,21 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1642700792,
|
||||||
|
"narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "846b2ae0fc4cc943637d3d1def4454213e203cba",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-utils_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1656928814,
|
"lastModified": 1656928814,
|
||||||
"narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=",
|
"narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=",
|
||||||
@ -72,7 +106,7 @@
|
|||||||
},
|
},
|
||||||
"musnix": {
|
"musnix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs_2"
|
"nixpkgs": "nixpkgs_3"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1628019651,
|
"lastModified": 1628019651,
|
||||||
@ -89,6 +123,22 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1643381941,
|
||||||
|
"narHash": "sha256-pHTwvnN4tTsEKkWlXQ8JMY423epos8wUOhthpwJjtpc=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "5efc8ca954272c4376ac929f4c5ffefcc20551d5",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixpkgs-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 0,
|
"lastModified": 0,
|
||||||
"narHash": "sha256-mO+23f3SO+fBzEvbxRe6GkSB5Xp43CT2sV8Rs8MYdz8=",
|
"narHash": "sha256-mO+23f3SO+fBzEvbxRe6GkSB5Xp43CT2sV8Rs8MYdz8=",
|
||||||
@ -100,7 +150,7 @@
|
|||||||
"type": "indirect"
|
"type": "indirect"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1623743177,
|
"lastModified": 1623743177,
|
||||||
"narHash": "sha256-57OM8Ya/yGHAHBq/h0I8Ah/HJFmk0VNpEASYxr+BgK8=",
|
"narHash": "sha256-57OM8Ya/yGHAHBq/h0I8Ah/HJFmk0VNpEASYxr+BgK8=",
|
||||||
@ -116,7 +166,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
"nixpkgs_4": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1658737577,
|
"lastModified": 1658737577,
|
||||||
"narHash": "sha256-xosJ5nJT9HX+b6UWsSX6R+ap4AdZOCrl/r+IKFp2ASQ=",
|
"narHash": "sha256-xosJ5nJT9HX+b6UWsSX6R+ap4AdZOCrl/r+IKFp2ASQ=",
|
||||||
@ -149,11 +199,12 @@
|
|||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
|
"devshell": "devshell",
|
||||||
"emacs-overlay": "emacs-overlay",
|
"emacs-overlay": "emacs-overlay",
|
||||||
"hardware": "hardware",
|
"hardware": "hardware",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"musnix": "musnix",
|
"musnix": "musnix",
|
||||||
"nixpkgs": "nixpkgs_3",
|
"nixpkgs": "nixpkgs_4",
|
||||||
"nur": "nur"
|
"nur": "nur"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
29
flake.nix
29
flake.nix
@ -20,12 +20,13 @@
|
|||||||
nur.url = "github:nix-community/NUR";
|
nur.url = "github:nix-community/NUR";
|
||||||
# nixvim.url = "github:pta2002/nixvim";
|
# nixvim.url = "github:pta2002/nixvim";
|
||||||
musnix.url = "github:musnix/musnix";
|
musnix.url = "github:musnix/musnix";
|
||||||
|
devshell.url = "github:numtide/devshell";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Outputs is a function that takes the inputs as arguments.
|
# Outputs is a function that takes the inputs as arguments.
|
||||||
# To handle extra arguments we use the inputs@ pattern.
|
# To handle extra arguments we use the inputs@ pattern.
|
||||||
# It gives a name to the ... ellipses.
|
# It gives a name to the ... ellipses.
|
||||||
outputs = inputs@{ nixpkgs, home-manager, ... }:
|
outputs = inputs@{ nixpkgs, home-manager, devshell, ... }:
|
||||||
|
|
||||||
# With let you can define local variables
|
# With let you can define local variables
|
||||||
let
|
let
|
||||||
@ -41,10 +42,32 @@
|
|||||||
emacs = inputs.emacs-overlay.overlay;
|
emacs = inputs.emacs-overlay.overlay;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pkgs = import nixpkgs {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
config.allowUnfree = true;
|
||||||
|
overlays = [ devshell.overlay ];
|
||||||
|
};
|
||||||
|
|
||||||
# The rec expression turns a basic set into a set where self-referencing is possible.
|
# The rec expression turns a basic set into a set where self-referencing is possible.
|
||||||
# It is a shorthand for recursive and allows to use the values defined in this set from its own scope.
|
# It is a shorthand for recursive and allows to use the values defined in this set from its own scope.
|
||||||
in rec {
|
in rec {
|
||||||
|
|
||||||
|
devShells."x86_64-linux".default = pkgs.devshell.mkShell {
|
||||||
|
name = "NixFlake Shell";
|
||||||
|
|
||||||
|
packages = with pkgs; [
|
||||||
|
jetbrains.clion
|
||||||
|
];
|
||||||
|
|
||||||
|
commands = [
|
||||||
|
{
|
||||||
|
name = "ide";
|
||||||
|
help = "Launch clion in this folder";
|
||||||
|
command = "clion ./ &>/dev/null &";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
# System configurations + HomeManager module
|
# System configurations + HomeManager module
|
||||||
# Accessible via 'nixos-rebuild'
|
# Accessible via 'nixos-rebuild'
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
@ -60,7 +83,7 @@
|
|||||||
|
|
||||||
# TODO: Modularize
|
# TODO: Modularize
|
||||||
./nixos/configuration.nix
|
./nixos/configuration.nix
|
||||||
./nixos/configuration-desktop.nix
|
./nixos/configuration-nixinator.nix
|
||||||
|
|
||||||
# TODO: Investigate this { ... } module syntax
|
# TODO: Investigate this { ... } module syntax
|
||||||
# Overlays
|
# Overlays
|
||||||
@ -94,7 +117,7 @@
|
|||||||
modules = [
|
modules = [
|
||||||
# TODO: Modularize
|
# TODO: Modularize
|
||||||
./nixos/configuration.nix
|
./nixos/configuration.nix
|
||||||
./nixos/configuration-laptop.nix
|
./nixos/configuration-nixtop.nix
|
||||||
|
|
||||||
# TODO: Investigate this { ... } module syntax
|
# TODO: Investigate this { ... } module syntax
|
||||||
# Overlays
|
# Overlays
|
||||||
|
@ -1,43 +0,0 @@
|
|||||||
{
|
|
||||||
description = "BSEos flake for development shell";
|
|
||||||
|
|
||||||
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
||||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
|
||||||
inputs.devshell.url = "github:numtide/devshell";
|
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils, devshell }:
|
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
|
||||||
let
|
|
||||||
pkgs = import nixpkgs {
|
|
||||||
inherit system;
|
|
||||||
config.allowUnfree = true; # For clion
|
|
||||||
overlays = [ devshell.overlay ];
|
|
||||||
};
|
|
||||||
|
|
||||||
in {
|
|
||||||
devShell = pkgs.devshell.mkShell {
|
|
||||||
name = "NixFlake";
|
|
||||||
|
|
||||||
packages = with pkgs; [
|
|
||||||
jetbrains.clion
|
|
||||||
];
|
|
||||||
commands = [
|
|
||||||
{
|
|
||||||
name = "ide";
|
|
||||||
help = "Run clion for project";
|
|
||||||
command = "clion &>/dev/null ./ &";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "rebuild";
|
|
||||||
help = "Build the configuration and activate the system";
|
|
||||||
command = "sudo nixos-rebuild switch --flake .#nixinator";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
name = "upgrade";
|
|
||||||
help = "Upgrade the flake, rebuild the system and show diff";
|
|
||||||
command = "nix flake update && sudo nixos-rebuild build --flake .#nixinator && nvd diff /run/current-system result";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
Reference in New Issue
Block a user