mirror of
https://github.com/donovanglover/nix-config.git
synced 2024-11-25 17:53:17 +01:00
meta: Add dev container
Note that this container uses home-manager from the Nix flake on the host system, which is pretty cool. Currently modules in this repository *don't* differentiate between home-manager and nixos, but this could be changed in the future to support e.g. my home-manager neovim config on a non-nixos system.
This commit is contained in:
parent
9692307bd9
commit
cbdd5998ec
62
containers/dev.nix
Normal file
62
containers/dev.nix
Normal file
@ -0,0 +1,62 @@
|
||||
{ home-manager, ... }:
|
||||
let
|
||||
VARIABLES = import ../src/variables.nix;
|
||||
in
|
||||
{
|
||||
containers.dev = {
|
||||
privateNetwork = true;
|
||||
ephemeral = true;
|
||||
autoStart = true;
|
||||
hostAddress = "192.168.100.30";
|
||||
localAddress = "192.168.100.31";
|
||||
|
||||
bindMounts = {
|
||||
"/mnt" = {
|
||||
hostPath = "/home/${VARIABLES.username}/containers/dev";
|
||||
isReadOnly = false;
|
||||
};
|
||||
};
|
||||
|
||||
config = { pkgs, lib, ... }: {
|
||||
imports = [
|
||||
home-manager.nixosModules.home-manager
|
||||
../modules/git
|
||||
../modules/neovim
|
||||
];
|
||||
|
||||
programs = {
|
||||
fish.enable = true;
|
||||
neovim.enable = true;
|
||||
starship.enable = true;
|
||||
};
|
||||
|
||||
users = {
|
||||
defaultUserShell = pkgs.fish;
|
||||
mutableUsers = false;
|
||||
allowNoPasswordLogin = true;
|
||||
|
||||
users.user = {
|
||||
isNormalUser = true;
|
||||
home = "/home/user";
|
||||
};
|
||||
};
|
||||
|
||||
home-manager.users.user = { pkgs, ... }: {
|
||||
home.packages = [ pkgs.atool pkgs.httpie ];
|
||||
home.stateVersion = VARIABLES.stateVersion;
|
||||
};
|
||||
|
||||
environment = {
|
||||
shells = with pkgs; [ fish ];
|
||||
|
||||
variables = { TERM = "xterm-kitty"; };
|
||||
|
||||
defaultPackages = [ ];
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [ kitty ];
|
||||
|
||||
system.stateVersion = VARIABLES.stateVersion;
|
||||
};
|
||||
};
|
||||
}
|
@ -15,6 +15,7 @@ let VARIABLES = import ./variables.nix; in {
|
||||
../modules
|
||||
../containers/rar.nix
|
||||
../containers/wine.nix
|
||||
../containers/dev.nix
|
||||
];
|
||||
|
||||
# locale
|
||||
|
Loading…
Reference in New Issue
Block a user