mirror of
https://github.com/sbrow/nix.git
synced 2026-02-27 21:31:45 -05:00
feat: Added new default template that is devShell based.
This commit is contained in:
1
templates/default/.envrc
Normal file
1
templates/default/.envrc
Normal file
@@ -0,0 +1 @@
|
|||||||
|
use flake
|
||||||
3
templates/default/.gitignore
vendored
3
templates/default/.gitignore
vendored
@@ -1 +1,4 @@
|
|||||||
|
.direnv
|
||||||
.vagrant
|
.vagrant
|
||||||
|
node_modules
|
||||||
|
vendor
|
||||||
|
|||||||
@@ -11,24 +11,16 @@
|
|||||||
|
|
||||||
outputs = { self, flake-utils, nixpkgs, sbrow }:
|
outputs = { self, flake-utils, nixpkgs, sbrow }:
|
||||||
flake-utils.lib.eachSystem flake-utils.lib.allSystems
|
flake-utils.lib.eachSystem flake-utils.lib.allSystems
|
||||||
(system: {
|
(system:
|
||||||
formatter = nixpkgs.legacyPackages.${system}.nixpkgs-fmt;
|
let pkgs = nixpkgs.legacyPackages.${system}; in
|
||||||
}) // {
|
{
|
||||||
nixosModules.default = { config, pkgs, ... }: {
|
formatter = pkgs.nixpkgs-fmt;
|
||||||
config = {
|
|
||||||
environment.systemPackages = [ pkgs.git ];
|
|
||||||
/* Your config here */
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# A Vagrant box for testing
|
devShells.default = pkgs.mkShell
|
||||||
nixosConfigurations.vagrant = nixpkgs.lib.nixosSystem {
|
{
|
||||||
system = "x86_64-linux";
|
buildInputs = with pkgs; [
|
||||||
modules = [
|
# Your packages here
|
||||||
(nixpkgs + "/nixos/modules/virtualisation/virtualbox-image.nix")
|
|
||||||
sbrow.nixosModules.vagrant
|
|
||||||
self.nixosModules.default
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
1
templates/vagrant/.gitignore
vendored
Normal file
1
templates/vagrant/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.vagrant
|
||||||
32
templates/vagrant/Vagrantfile
vendored
Normal file
32
templates/vagrant/Vagrantfile
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# -*- mode: ruby -*-
|
||||||
|
# vi: set ft=ruby :
|
||||||
|
|
||||||
|
Vagrant.configure("2") do |config|
|
||||||
|
config.vm.box = "nixos"
|
||||||
|
|
||||||
|
# Disable automatic box update checking. If you disable this, then
|
||||||
|
# boxes will only be checked for updates when the user runs
|
||||||
|
# `vagrant box outdated`. This is not recommended.
|
||||||
|
# config.vm.box_check_update = false
|
||||||
|
|
||||||
|
# config.vm.network "forwarded_port", guest: 80, host: 80
|
||||||
|
# config.vm.network "forwarded_port", guest: 443, host: 443
|
||||||
|
config.vm.network "private_network", ip: "192.168.56.44", auto_config: false
|
||||||
|
# config.vm.network "public_network"
|
||||||
|
|
||||||
|
config.vm.provider "virtualbox" do |vb|
|
||||||
|
# Display the VirtualBox GUI when booting the machine
|
||||||
|
vb.gui = false
|
||||||
|
|
||||||
|
# Customize the amount of memory on the VM:
|
||||||
|
# vb.memory = 4 * 1024
|
||||||
|
|
||||||
|
# vb.cpus = 2;
|
||||||
|
end
|
||||||
|
|
||||||
|
config.vm.provision "shell", inline: <<-SHELL
|
||||||
|
# nix develop 'nixpkgs#git' --command "sudo nixos-rebuild switch --flake /vagrant#vagrant"
|
||||||
|
nix-shell -p git --command "sudo nixos-rebuild switch --flake /vagrant#vagrant"
|
||||||
|
SHELL
|
||||||
|
end
|
||||||
|
|
||||||
34
templates/vagrant/flake.nix
Normal file
34
templates/vagrant/flake.nix
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
description = "A very basic flake";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
# nixpkgs.url = "github:NixOS/nixpkgs/23.05";
|
||||||
|
|
||||||
|
sbrow.url = "github:sbrow/nix";
|
||||||
|
|
||||||
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, flake-utils, nixpkgs, sbrow }:
|
||||||
|
flake-utils.lib.eachSystem flake-utils.lib.allSystems
|
||||||
|
(system: {
|
||||||
|
formatter = nixpkgs.legacyPackages.${system}.nixpkgs-fmt;
|
||||||
|
}) // {
|
||||||
|
nixosModules.default = { config, pkgs, ... }: {
|
||||||
|
config = {
|
||||||
|
environment.systemPackages = [ pkgs.git ];
|
||||||
|
/* Your config here */
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# A Vagrant box for testing
|
||||||
|
nixosConfigurations.vagrant = nixpkgs.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = [
|
||||||
|
(nixpkgs + "/nixos/modules/virtualisation/virtualbox-image.nix")
|
||||||
|
sbrow.nixosModules.vagrant
|
||||||
|
self.nixosModules.default
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user