From e443d1b868e2a9428ea1ea4e63e1a936503e5a61 Mon Sep 17 00:00:00 2001 From: "Tyrel A. Souza" Date: Tue, 17 Jan 2023 18:19:04 -0500 Subject: [PATCH] adding my first debian box --- Makefile | 6 +++- hosts/vostro/default.nix | 4 +++ hosts/vostro/flake.lock | 64 +++++++++++++++++++++++++++++++++++ hosts/vostro/flake.nix | 36 ++++++++++++++++++++ hosts/vostro/home-manager.nix | 15 ++++++++ hosts/vostro/home.nix | 12 +++++++ justfile | 12 ++++++- 7 files changed, 147 insertions(+), 2 deletions(-) create mode 100644 hosts/vostro/default.nix create mode 100644 hosts/vostro/flake.lock create mode 100644 hosts/vostro/flake.nix create mode 100644 hosts/vostro/home-manager.nix create mode 100644 hosts/vostro/home.nix diff --git a/Makefile b/Makefile index 8732187..64a87f8 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,11 @@ ## Setup -.PHONY: rebuild-macos +.PHONY: install-just install-nix ## Management install-just: curl --proto '=https' --tlsv1.3 -sSf https://just.systems/install.sh | bash -s -- --to ~/ sudo cp ~/just /usr/local/bin + +install-nix: + sh <(curl -L https://nixos.org/nix/install) --daemon + diff --git a/hosts/vostro/default.nix b/hosts/vostro/default.nix new file mode 100644 index 0000000..8c55841 --- /dev/null +++ b/hosts/vostro/default.nix @@ -0,0 +1,4 @@ +{ pkgs, config, lib, ... }: +{ + programs.zsh.enable = true; +} diff --git a/hosts/vostro/flake.lock b/hosts/vostro/flake.lock new file mode 100644 index 0000000..7e2d60f --- /dev/null +++ b/hosts/vostro/flake.lock @@ -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 +} diff --git a/hosts/vostro/flake.nix b/hosts/vostro/flake.nix new file mode 100644 index 0000000..01e3aa3 --- /dev/null +++ b/hosts/vostro/flake.nix @@ -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"; + }; + } + ]; + + + }; + }; + }; +} + diff --git a/hosts/vostro/home-manager.nix b/hosts/vostro/home-manager.nix new file mode 100644 index 0000000..e0af78a --- /dev/null +++ b/hosts/vostro/home-manager.nix @@ -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"; + }; + + +} diff --git a/hosts/vostro/home.nix b/hosts/vostro/home.nix new file mode 100644 index 0000000..a57c409 --- /dev/null +++ b/hosts/vostro/home.nix @@ -0,0 +1,12 @@ +{ pkgs, ... }: +{ + home.stateVersion = "22.05"; + home.sessionVariables = { + }; + home.packages = with pkgs; [ + ]; + + home.file = { + }; + +} diff --git a/justfile b/justfile index e580f1f..2e435fa 100644 --- a/justfile +++ b/justfile @@ -1,7 +1,11 @@ #!/usr/bin/env -S just --justfile # 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//'` 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-shell '' -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 '' -A install + git-add: git add .