diff options
author | Cole Mickens <cole.mickens@gmail.com> | 2020-03-27 19:59:18 +0000 |
---|---|---|
committer | Jon <jonringer@users.noreply.github.com> | 2020-03-29 13:56:55 -0700 |
commit | c2b2cc6dbdc02a9b1b3450d24c4b387e5c2203b7 (patch) | |
tree | 06f64414a9c6691ec482910301558dfc6c5a68c6 /nixos | |
parent | 20f981de08d8bc407d0897c03b963f5aba6fda50 (diff) |
nixos/azure: simplify example image
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/maintainers/scripts/azure-new/README.md | 5 | ||||
-rw-r--r-- | nixos/maintainers/scripts/azure-new/examples/basic/system.nix | 35 |
2 files changed, 17 insertions, 23 deletions
diff --git a/nixos/maintainers/scripts/azure-new/README.md b/nixos/maintainers/scripts/azure-new/README.md index 1bc8d8a29384..ee1fc682534c 100644 --- a/nixos/maintainers/scripts/azure-new/README.md +++ b/nixos/maintainers/scripts/azure-new/README.md @@ -6,6 +6,11 @@ Here's a demo of this being used: https://asciinema.org/a/euXb9dIeUybE3VkstLWLbv ## Usage +This is meant to be an example image that you can copy into your own +project and modify to your own needs. Notice that the example image +includes a built-in test user account, which by default uses your +`~/.ssh/id_ed25519.pub` as an `authorized_key`. + Build and upload the image ```shell $ ./upload-image.sh ./examples/basic/image.nix diff --git a/nixos/maintainers/scripts/azure-new/examples/basic/system.nix b/nixos/maintainers/scripts/azure-new/examples/basic/system.nix index 7e4d245d6ccf..5f98216d183d 100644 --- a/nixos/maintainers/scripts/azure-new/examples/basic/system.nix +++ b/nixos/maintainers/scripts/azure-new/examples/basic/system.nix @@ -1,42 +1,31 @@ { pkgs, modulesPath, ... }: +let username = "azurenixosuser"; +in { imports = [ "${modulesPath}/virtualisation/azure-common.nix" "${modulesPath}/virtualisation/azure-image.nix" ]; - ##### test user ###### - users.extraGroups."cole".gid = 1000; - users.extraUsers."cole" = { - isNormalUser = true; - home = "/home/cole"; - description = "Cole Mickens"; - openssh.authorizedKeys.keys = ["ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC9YAN+P0umXeSP/Cgd5ZvoD5gpmkdcrOjmHdonvBbptbMUbI/Zm0WahBDK0jO5vfJ/C6A1ci4quMGCRh98LRoFKFRoWdwlGFcFYcLkuG/AbE8ObNLHUxAwqrdNfIV6z0+zYi3XwVjxrEqyJ/auZRZ4JDDBha2y6Wpru8v9yg41ogeKDPgHwKOf/CKX77gCVnvkXiG5ltcEZAamEitSS8Mv8Rg/JfsUUwULb6yYGh+H6RECKriUAl9M+V11SOfv8MAdkXlYRrcqqwuDAheKxNGHEoGLBk+Fm+orRChckW1QcP89x6ioxpjN9VbJV0JARF+GgHObvvV+dGHZZL1N3jr8WtpHeJWxHPdBgTupDIA5HeL0OCoxgSyyfJncMl8odCyUqE+lqXVz+oURGeRxnIbgJ07dNnX6rFWRgQKrmdV4lt1i1F5Uux9IooYs/42sKKMUQZuBLTN4UzipPQM/DyDO01F0pdcaPEcIO+tp2U6gVytjHhZqEeqAMaUbq7a6ucAuYzczGZvkApc85nIo9jjW+4cfKZqV8BQfJM1YnflhAAplIq6b4Tzayvw1DLXd2c5rae+GlVCsVgpmOFyT6bftSon/HfxwBE4wKFYF7fo7/j6UbAeXwLafDhX+S5zSNR6so1epYlwcMLshXqyJePJNhtsRhpGLd9M3UqyGDAFoOQ== (none)"]; - #mkpasswd -m sha-512 - hashedPassword = "$6$k.vT0coFt3$BbZN9jqp6Yw75v9H/wgFs9MZfd5Ycsfthzt3Jdw8G93YhaiFjkmpY5vCvJ.HYtw0PZOye6N9tBjNS698tM3i/1"; - uid = 1000; - group = "cole"; - }; - nix.trustedUsers = [ "cole" ]; - ##### test user ###### + users.users."${username}" = { + isNormalUser = true; + home = "/home/${username}"; + description = "Azure NixOS Test User"; + openssh.authorizedKeys.keys = [ (builtins.readFile ~/.ssh/id_ed25519.pub) ]; + }; + nix.trustedUsers = [ username ]; virtualisation.azureImage.diskSize = 2500; system.stateVersion = "20.03"; - networking.hostName = "azbuildworld"; boot.kernelPackages = pkgs.linuxPackages_latest; - #environment.noXlibs = true; - #documentation.enable = false; - #documentation.nixos.enable = false; - + # test user doesn't have a password services.openssh.passwordAuthentication = false; - programs.mosh.enable = true; - security.sudo.wheelNeedsPassword = false; - + environment.systemPackages = with pkgs; [ - git neovim jq file htop ripgrep cachix wget curl tmux zsh + git file htop wget curl ]; } |