adding my first debian box

This commit is contained in:
Tyrel A. Souza 2023-01-17 18:19:04 -05:00
parent 44e4587baf
commit e443d1b868
7 changed files with 147 additions and 2 deletions

View File

@ -1,7 +1,11 @@
## Setup ## Setup
.PHONY: rebuild-macos .PHONY: install-just install-nix
## Management ## Management
install-just: install-just:
curl --proto '=https' --tlsv1.3 -sSf https://just.systems/install.sh | bash -s -- --to ~/ curl --proto '=https' --tlsv1.3 -sSf https://just.systems/install.sh | bash -s -- --to ~/
sudo cp ~/just /usr/local/bin sudo cp ~/just /usr/local/bin
install-nix:
sh <(curl -L https://nixos.org/nix/install) --daemon

4
hosts/vostro/default.nix Normal file
View File

@ -0,0 +1,4 @@
{ pkgs, config, lib, ... }:
{
programs.zsh.enable = true;
}

64
hosts/vostro/flake.lock Normal file
View File

@ -0,0 +1,64 @@
{
"nodes": {
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"utils": "utils"
},
"locked": {
"lastModified": 1672688183,
"narHash": "sha256-3sNEWKTg3XXVDnvzVatdyetiUQWL+ibJ1YkvxSk3PuM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "c1a830c8fabb13f95f51ecf48552f0a794d8718a",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1672525397,
"narHash": "sha256-WASDnyxHKWVrEe0dIzkpH+jzKlCKAk0husv0f/9pyxg=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "8ba56d7c0d7490680f2d51ba46a141eca7c46afa",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs"
}
},
"utils": {
"locked": {
"lastModified": 1667395993,
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

36
hosts/vostro/flake.nix Normal file
View File

@ -0,0 +1,36 @@
{
description = "Tyrel Nix";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, home-manager } :
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
in {
defaultPackage.x86_64-linux = home-manager.defaultPackage.x86_64-linux;
homeConfigurations = {
"tyrel" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
./default.nix
./home-manager.nix
{
home = {
homeDirectory = "/home/tyrel";
username = "tyrel";
stateVersion = "22.05";
};
}
];
};
};
};
}

View File

@ -0,0 +1,15 @@
{ pkgs, ... }:
{
# Common Imports
imports = [
./home.nix
../_common/home.nix
../_common/programs.nix
../_common/xdg.nix
];
home.sessionVariables = {
XDG_CONFIG_HOME = "/home/tyrel/.config";
};
}

12
hosts/vostro/home.nix Normal file
View File

@ -0,0 +1,12 @@
{ pkgs, ... }:
{
home.stateVersion = "22.05";
home.sessionVariables = {
};
home.packages = with pkgs; [
];
home.file = {
};
}

View File

@ -1,7 +1,11 @@
#!/usr/bin/env -S just --justfile #!/usr/bin/env -S just --justfile
# Naive check if /Users or /home for home. # Naive check if /Users or /home for home.
OS := if "${HOME}" =~ '/U.*' { "macos" } else { "ubuntu" } OS := if "${HOME}" =~ '/U.*' {
"macos"
} else {
if `cat /etc/issue | grep -i debian` =~ "Deb.*" { "debian" } else { "ubuntu" }
}
HOSTNAME := `hostname| sed 's/.local//'` HOSTNAME := `hostname| sed 's/.local//'`
NIXPATH := "nixpkgs=/nix/var/nix/profiles/per-user/tyrel/channels/nixpkgs:/nix/var/nix/profiles/per-user/tyrel/channels" NIXPATH := "nixpkgs=/nix/var/nix/profiles/per-user/tyrel/channels/nixpkgs:/nix/var/nix/profiles/per-user/tyrel/channels"
@ -14,6 +18,12 @@ setup-ubuntu:
NIX_PATH={{NIXPATH}} nix-channel --update NIX_PATH={{NIXPATH}} nix-channel --update
NIX_PATH={{NIXPATH}} nix-shell '<home-manager>' -A install NIX_PATH={{NIXPATH}} nix-shell '<home-manager>' -A install
setup-debian:
NIX_PATH={{NIXPATH}} nix-channel --add https://nixos.org/channels/nixos-22.11 nixos
NIX_PATH={{NIXPATH}} nix-channel --add https://github.com/nix-community/home-manager/archive/release-22.11.tar.gz home-manager
NIX_PATH={{NIXPATH}} nix-channel --update
NIX_PATH={{NIXPATH}} nix-shell '<home-manager>' -A install
git-add: git-add:
git add . git add .